pidgin: c5a017ca: Unleak pad if more pads are linked.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Fri Aug 7 05:31:57 EDT 2009


-----------------------------------------------------------------
Revision: c5a017ca69d826e43efef171aa5e724438c1fe50
Ancestor: a0674ed0c2d29c63fee2f96c7b09c782076cb1a9
Author: maiku at soc.pidgin.im
Date: 2009-08-07T09:25:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c5a017ca69d826e43efef171aa5e724438c1fe50

Modified files:
        libpurple/mediamanager.c

ChangeLog: 

Unleak pad if more pads are linked.

-------------- next part --------------
============================================================
--- libpurple/mediamanager.c	6a7e7dac424b29d7531f231e6eb48458a2e27a25
+++ libpurple/mediamanager.c	69b04a13255d2e944c1bae74654d426cbc4d1428
@@ -399,15 +399,19 @@ request_pad_unlinked_cb(GstPad *pad, Gst
 	GstElement *parent = GST_ELEMENT_PARENT(pad);
 	GstIterator *iter;
 	GstPad *remaining_pad;
+	GstIteratorResult result;
 
 	gst_element_release_request_pad(GST_ELEMENT_PARENT(pad), pad);
-	iter = gst_element_iterate_pads(parent);
+	iter = gst_element_iterate_src_pads(parent);
 
-	if (gst_iterator_next(iter, (gpointer)&remaining_pad)
-			== GST_ITERATOR_DONE) {
+	result = gst_iterator_next(iter, (gpointer)&remaining_pad);
+
+	if (result == GST_ITERATOR_DONE) {
 		gst_element_set_locked_state(parent, TRUE);
 		gst_element_set_state(parent, GST_STATE_NULL);
 		gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(parent)), parent);
+	} else if (result == GST_ITERATOR_OK) {
+		gst_object_unref(remaining_pad);
 	}
 
 	gst_iterator_free(iter);


More information about the Commits mailing list