mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
gdiscreencapsrc: fix memory leak
Structure members of ICONINFO struct filled by GetIconInfo() must be deleted when no longer needed according to the API reference. https://bugzilla.gnome.org/show_bug.cgi?id=611428
This commit is contained in:
parent
aae382bcc6
commit
6792b0fb16
1 changed files with 4 additions and 0 deletions
|
@ -541,12 +541,16 @@ gst_gdiscreencapsrc_screen_capture (GstGDIScreenCapSrc * src, GstBuffer * buf)
|
||||||
GetCursorInfo (&ci);
|
GetCursorInfo (&ci);
|
||||||
if (ci.flags & CURSOR_SHOWING) {
|
if (ci.flags & CURSOR_SHOWING) {
|
||||||
ICONINFO ii;
|
ICONINFO ii;
|
||||||
|
|
||||||
GetIconInfo (ci.hCursor, &ii);
|
GetIconInfo (ci.hCursor, &ii);
|
||||||
|
|
||||||
DrawIconEx (src->memDC,
|
DrawIconEx (src->memDC,
|
||||||
ci.ptScreenPos.x - src->src_rect.left - ii.xHotspot,
|
ci.ptScreenPos.x - src->src_rect.left - ii.xHotspot,
|
||||||
ci.ptScreenPos.y - src->src_rect.top - ii.yHotspot, ci.hCursor, 0, 0,
|
ci.ptScreenPos.y - src->src_rect.top - ii.yHotspot, ci.hCursor, 0, 0,
|
||||||
0, NULL, DI_DEFAULTSIZE | DI_NORMAL | DI_COMPAT);
|
0, NULL, DI_DEFAULTSIZE | DI_NORMAL | DI_COMPAT);
|
||||||
|
|
||||||
|
DeleteObject (ii.hbmColor);
|
||||||
|
DeleteObject (ii.hbmMask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue