Commit ea97859c authored by rogerdpack's avatar rogerdpack Committed by Michael Niedermayer

gdigrab: fix gdi object leak if using mouse

based on patch from hlszl1983@163.com
Signed-off-by: 's avatarrogerdpack <rogerpack2005@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9a07c15f
......@@ -440,6 +440,8 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
POINT pos;
RECT clip_rect = gdigrab->clip_rect;
HWND hwnd = gdigrab->hwnd;
info.hbmMask = NULL;
info.hbmColor = NULL;
if (ci.flags != CURSOR_SHOWING)
return;
......@@ -481,6 +483,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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment