hi, all

I'm using gdigrab feature on windows, and found that the count of gdi objects 
owned by ffmpeg.exe increasing endlessly...
 
Here is the patch, can someone commit it?
----------------------------------------------
diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c 
index bccfef2..e2bed14 100644 
--- a/libavdevice/gdigrab.c 
+++ b/libavdevice/gdigrab.c 
@@ -451,6 +451,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, 
struct gdigrab *gdigrab) 
icon = CopyCursor(LoadCursor(NULL, IDC_ARROW)); 
} 

+ /*Remarks 
+ *GetIconInfo creates bitmaps for the hbmMask and hbmColor members of 
ICONINFO. 
+ *The calling application must manage these bitmaps and delete them when they 
are no longer necessary. 
+ */ 
if (!GetIconInfo(icon, &info)) { 
CURSOR_ERROR("Could not get icon info"); 
goto icon_error; 
@@ -481,6 +485,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, 
struct gdigrab *gdigrab) 
} 

icon_error: 
+ if (info.hbmMask) 
+ DeleteObject(info.hbmMask); 
+ if(info.hbmColor) 
+ DeleteObject(info.hbmColor); 
if (icon) 
DestroyCursor(icon); 
} else {




hlszl1...@163.com
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to