mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
sys/ximage/gstximagesrc.c: Stop leaking the cursor image.
Original commit message from CVS: * sys/ximage/gstximagesrc.c: (gst_ximage_src_start), (gst_ximage_src_stop), (gst_ximage_src_ximage_get): Stop leaking the cursor image. Unref the last_ximage and the cached cursor image on shutdown. Fixes #551570.
This commit is contained in:
parent
300da1655b
commit
419ede208d
2 changed files with 20 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
2008-10-03 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* sys/ximage/gstximagesrc.c: (gst_ximage_src_start),
|
||||
(gst_ximage_src_stop), (gst_ximage_src_ximage_get):
|
||||
Stop leaking the cursor image.
|
||||
Unref the last_ximage and the cached cursor image on shutdown.
|
||||
Fixes #551570.
|
||||
|
||||
2008-10-03 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* sys/v4l2/gstv4l2object.h:
|
||||
|
|
|
@ -210,6 +210,8 @@ gst_ximage_src_start (GstBaseSrc * basesrc)
|
|||
|
||||
s->last_frame_no = -1;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
if (s->last_ximage)
|
||||
gst_buffer_unref (GST_BUFFER_CAST (s->last_ximage));
|
||||
s->last_ximage = NULL;
|
||||
#endif
|
||||
return gst_ximage_src_open_display (s, s->display_name);
|
||||
|
@ -220,8 +222,16 @@ gst_ximage_src_stop (GstBaseSrc * basesrc)
|
|||
{
|
||||
GstXImageSrc *src = GST_XIMAGE_SRC (basesrc);
|
||||
|
||||
if (src->last_ximage)
|
||||
gst_buffer_unref (GST_BUFFER_CAST (src->last_ximage));
|
||||
src->last_ximage = NULL;
|
||||
|
||||
gst_ximage_src_clear_bufpool (src);
|
||||
|
||||
if (src->cursor_image)
|
||||
XFree (src->cursor_image);
|
||||
src->cursor_image = NULL;
|
||||
|
||||
if (src->xcontext) {
|
||||
g_mutex_lock (src->x_lock);
|
||||
|
||||
|
@ -604,6 +614,8 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
|
|||
|
||||
GST_DEBUG_OBJECT (ximagesrc, "Using XFixes to draw cursor");
|
||||
/* get cursor */
|
||||
if (ximagesrc->cursor_image)
|
||||
XFree (ximagesrc->cursor_image);
|
||||
ximagesrc->cursor_image = XFixesGetCursorImage (ximagesrc->xcontext->disp);
|
||||
if (ximagesrc->cursor_image != NULL) {
|
||||
int cx, cy, i, j, count;
|
||||
|
|
Loading…
Reference in a new issue