gstelement: Start over if subclass removed the next pad too
authorMatej Knopp <matej.knopp@gmail.com>
Sun, 10 Jun 2012 16:41:12 +0000 (12:41 -0400)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 11 Jun 2012 08:43:34 +0000 (10:43 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677818

gst/gstelement.c

index 2962830..38f0ee4 100644 (file)
@@ -2851,6 +2851,10 @@ gst_element_dispose (GObject * object)
       GST_CAT_DEBUG_OBJECT (GST_CAT_ELEMENT_PADS, element,
           "removing request pad %s:%s", GST_DEBUG_PAD_NAME (pad));
       oclass->release_pad (element, pad);
+
+      /* in case the release_pad function removed the next pad too */
+      if (walk && g_list_position (element->pads, walk) == -1)
+        walk = element->pads;
     }
   }
   /* remove the remaining pads */