From f77a290549bfe71c759ef6219a0fb23f4110ebf9 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Sun, 11 Dec 2005 22:26:08 +0000 Subject: sys/xvimage/xvimagesink.c: Fixed a leak of the current image reference when cleaning up. Original commit message from CVS: 2005-12-11 Julien MOUTTE * sys/xvimage/xvimagesink.c: (gst_xvimagesink_change_state): Fixed a leak of the current image reference when cleaning up. Thanks to Arwed von Merkatz (alley_cat) for pointing it out. --- sys/xvimage/xvimagesink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 92ab68c2..fb99da31 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1703,11 +1703,14 @@ gst_xvimagesink_change_state (GstElement * element, GstStateChange transition) break; case GST_STATE_CHANGE_READY_TO_NULL: xvimagesink->running = FALSE; + if (xvimagesink->cur_image) { + gst_buffer_unref (xvimagesink->cur_image); + xvimagesink->cur_image = NULL; + } if (xvimagesink->xvimage) { - gst_xvimage_buffer_free (xvimagesink->xvimage); + gst_buffer_unref (xvimagesink->xvimage); xvimagesink->xvimage = NULL; } - if (xvimagesink->image_pool) gst_xvimagesink_imagepool_clear (xvimagesink); -- cgit