[gst-devel] patch gstelement.c?

Jim Thornton jthornton at parc.com
Fri Mar 22 19:21:03 CET 2002

Ok, this one is more of a question:

If you do a gst_object_destroy of an object that is in a bin before you 
gst_object_destroy the bin, the parent pointer gets cleared (in 
gst_object_dispose) but the object (element) gets left in the bin children 
list causing havoc later when you try to gst_object_destroy the bin 
itself.  Ok, maybe you are only supposed to ever call gst_object_destroy 
on a top-level thing, or call gst_bin_remove manually, but this doesn't 
seem right to me.  I tried adding the following to gst_element_dispose:

>   /* remove ourselves from containing bin */
>   if (gst_element_get_parent(element)) {
>     gst_bin_remove(GST_BIN_CAST(gst_element_get_parent(element)), 
>   }

and that sure does the trick.  The problem is that now I'm getting 

(process:14959): GThread-ERROR **: file gthread-posix.c: line 226 
(g_cond_free_posix_impl): error 'Device or resource busy' during 
'pthread_cond_destroy ((pthread_cond_t *) cond)'

out of the g_cond_free() (I believe) in the end of gst_element_dispose.

More information about the gstreamer-devel mailing list