mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-12 03:16:33 +00:00
Slighly take a different approach for object destruction, using the real _remove functions so that the scheduler has ...
Original commit message from CVS: Slighly take a different approach for object destruction, using the real _remove functions so that the scheduler has a chance to destroy its state too. This breaks the thread with ghostpads destruction case for now.
This commit is contained in:
parent
07aeaa83d5
commit
d374791e8b
3 changed files with 21 additions and 15 deletions
11
gst/gstbin.c
11
gst/gstbin.c
|
@ -498,20 +498,23 @@ static void
|
||||||
gst_bin_real_destroy (GtkObject *object)
|
gst_bin_real_destroy (GtkObject *object)
|
||||||
{
|
{
|
||||||
GstBin *bin = GST_BIN (object);
|
GstBin *bin = GST_BIN (object);
|
||||||
GList *children;
|
GList *children, *orig;
|
||||||
GstElement *child;
|
GstElement *child;
|
||||||
|
|
||||||
GST_DEBUG (GST_CAT_REFCOUNTING,"destroy()\n");
|
GST_DEBUG (GST_CAT_REFCOUNTING,"destroy()\n");
|
||||||
|
|
||||||
children = bin->children;
|
if (bin->children) {
|
||||||
|
orig = children = g_list_copy (bin->children);
|
||||||
while (children) {
|
while (children) {
|
||||||
child = GST_ELEMENT (children->data);
|
child = GST_ELEMENT (children->data);
|
||||||
//gst_object_unref (GST_OBJECT (child));
|
//gst_object_unref (GST_OBJECT (child));
|
||||||
gst_object_unparent (GST_OBJECT (child));
|
//gst_object_unparent (GST_OBJECT (child));
|
||||||
|
gst_bin_remove (bin, child);
|
||||||
children = g_list_next (children);
|
children = g_list_next (children);
|
||||||
}
|
}
|
||||||
|
g_list_free (orig);
|
||||||
g_list_free (bin->children);
|
g_list_free (bin->children);
|
||||||
|
}
|
||||||
bin->children = NULL;
|
bin->children = NULL;
|
||||||
bin->numchildren = 0;
|
bin->numchildren = 0;
|
||||||
|
|
||||||
|
|
|
@ -909,14 +909,17 @@ gst_element_real_destroy (GtkObject *object)
|
||||||
orig = pads = g_list_copy (element->pads);
|
orig = pads = g_list_copy (element->pads);
|
||||||
while (pads) {
|
while (pads) {
|
||||||
pad = GST_PAD (pads->data);
|
pad = GST_PAD (pads->data);
|
||||||
gst_object_destroy (GST_OBJECT (pad));
|
//gst_object_destroy (GST_OBJECT (pad));
|
||||||
|
gst_object_ref (GST_OBJECT (pad));
|
||||||
|
gst_element_remove_pad (element, pad);
|
||||||
|
gst_object_unref (GST_OBJECT (pad));
|
||||||
pads = g_list_next (pads);
|
pads = g_list_next (pads);
|
||||||
}
|
}
|
||||||
g_list_free (orig);
|
g_list_free (orig);
|
||||||
}
|
|
||||||
|
|
||||||
g_list_free (element->pads);
|
g_list_free (element->pads);
|
||||||
element->pads = NULL;
|
element->pads = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
element->numsrcpads = 0;
|
element->numsrcpads = 0;
|
||||||
element->numsinkpads = 0;
|
element->numsinkpads = 0;
|
||||||
|
|
||||||
|
|
|
@ -160,11 +160,11 @@ gst_thread_real_destroy (GtkObject *gtk_object)
|
||||||
g_mutex_free (thread->lock);
|
g_mutex_free (thread->lock);
|
||||||
g_cond_free (thread->cond);
|
g_cond_free (thread->cond);
|
||||||
|
|
||||||
gst_object_destroy (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
|
|
||||||
gst_object_unref (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
|
|
||||||
|
|
||||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||||
GTK_OBJECT_CLASS (parent_class)->destroy (gtk_object);
|
GTK_OBJECT_CLASS (parent_class)->destroy (gtk_object);
|
||||||
|
|
||||||
|
gst_object_destroy (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
|
||||||
|
gst_object_unref (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue