From f77a290549bfe71c759ef6219a0fb23f4110ebf9 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Sun, 11 Dec 2005 22:26:08 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ common | 2 +- sys/xvimage/xvimagesink.c | 7 +++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28cac2c1bc..2bdb187813 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. + 2005-12-09 Michael Smith * tools/Makefile.am: diff --git a/common b/common index fe94837afc..4edc214072 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit fe94837afc0b10eaf867156fc29eea0073ba45df +Subproject commit 4edc214072fe07d2aade96bc336493425654d7b4 diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 92ab68c298..fb99da31d2 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);