diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-10-03 15:54:07 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-10-03 15:54:07 +0000 |
commit | 419ede208d5ca0c8aac97a5b258d217f8abd03ce (patch) | |
tree | d41e732dbf2c58fe63869f4539a10c113b63ec87 | |
parent | 300da1655b180b75783da8f703d3fec85c9ee91c (diff) |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | sys/ximage/gstximagesrc.c | 12 |
2 files changed, 20 insertions, 0 deletions
@@ -1,5 +1,13 @@ 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: Getting the Class from an instance is not just a matter of casting it to the class struct but it involves calling G_OBJECT_GET_CLASS on the diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c index 14227f80..f6782b6b 100644 --- a/sys/ximage/gstximagesrc.c +++ b/sys/ximage/gstximagesrc.c @@ -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; |