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:
Francis Rammeloo 2010-12-13 23:15:05 +00:00 committed by Tim-Philipp Müller
parent aae382bcc6
commit 6792b0fb16

View file

@ -541,12 +541,16 @@ gst_gdiscreencapsrc_screen_capture (GstGDIScreenCapSrc * src, GstBuffer * buf)
GetCursorInfo (&ci);
if (ci.flags & CURSOR_SHOWING) {
ICONINFO ii;
GetIconInfo (ci.hCursor, &ii);
DrawIconEx (src->memDC,
ci.ptScreenPos.x - src->src_rect.left - ii.xHotspot,
ci.ptScreenPos.y - src->src_rect.top - ii.yHotspot, ci.hCursor, 0, 0,
0, NULL, DI_DEFAULTSIZE | DI_NORMAL | DI_COMPAT);
DeleteObject (ii.hbmColor);
DeleteObject (ii.hbmMask);
}
}