some object cleanup fixes
authorAndy Wingo <wingo@pobox.com>
Sun, 17 Feb 2002 19:58:29 +0000 (19:58 +0000)
committerAndy Wingo <wingo@pobox.com>
Sun, 17 Feb 2002 19:58:29 +0000 (19:58 +0000)
Original commit message from CVS:
some object cleanup fixes

gst/gstbin.c
gst/gstelement.c

index f92d305..9e8f768 100644 (file)
@@ -654,6 +654,9 @@ gst_bin_dispose (GObject * object)
 
   GST_DEBUG (GST_CAT_REFCOUNTING, "dispose\n");
 
+  if (gst_element_get_state (GST_ELEMENT (object)) == GST_STATE_PLAYING)
+    gst_element_set_state (GST_ELEMENT (object), GST_STATE_PAUSED);
+
   if (bin->children) {
     orig = children = g_list_copy (bin->children);
     while (children) {
index 20404cd..2c8485e 100644 (file)
@@ -1374,6 +1374,8 @@ gst_element_dispose (GObject *object)
   
   GST_DEBUG_ELEMENT (GST_CAT_REFCOUNTING, element, "dispose\n");
 
+  gst_element_set_state (element, GST_STATE_NULL);
+
   /* first we break all our connections with the ouside */
   if (element->pads) {
     GList *orig;