mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 23:18:47 +00:00
Added ghostpad destruction.
Original commit message from CVS: Added ghostpad destruction.
This commit is contained in:
parent
05a517acf1
commit
cff4720acf
3 changed files with 19 additions and 4 deletions
|
@ -254,6 +254,7 @@ gst_object_finalize (GtkObject *gtk_object)
|
||||||
object = GST_OBJECT (gtk_object);
|
object = GST_OBJECT (gtk_object);
|
||||||
|
|
||||||
GST_DEBUG (GST_CAT_REFCOUNTING, "finalize '%s'\n",GST_OBJECT_NAME(object));
|
GST_DEBUG (GST_CAT_REFCOUNTING, "finalize '%s'\n",GST_OBJECT_NAME(object));
|
||||||
|
|
||||||
if (object->name != NULL)
|
if (object->name != NULL)
|
||||||
g_free (object->name);
|
g_free (object->name);
|
||||||
|
|
||||||
|
|
17
gst/gstpad.c
17
gst/gstpad.c
|
@ -1035,7 +1035,22 @@ gst_real_pad_destroy (GtkObject *object)
|
||||||
gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (pad)), pad);
|
gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (pad)), pad);
|
||||||
|
|
||||||
// FIXME we should destroy the ghostpads, because they are nothing without the real pad
|
// FIXME we should destroy the ghostpads, because they are nothing without the real pad
|
||||||
g_list_free (GST_REAL_PAD(pad)->ghostpads);
|
if (GST_REAL_PAD (pad)->ghostpads) {
|
||||||
|
GList *orig, *ghostpads;
|
||||||
|
|
||||||
|
orig = ghostpads = g_list_copy (GST_REAL_PAD (pad)->ghostpads);
|
||||||
|
|
||||||
|
while (ghostpads) {
|
||||||
|
GstPad *ghostpad = GST_PAD (ghostpads->data);
|
||||||
|
|
||||||
|
if (GST_IS_ELEMENT (GST_OBJECT_PARENT (ghostpad)))
|
||||||
|
gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (ghostpad)), ghostpad);
|
||||||
|
|
||||||
|
ghostpads = g_list_next (ghostpads);
|
||||||
|
}
|
||||||
|
g_list_free (orig);
|
||||||
|
g_list_free (GST_REAL_PAD(pad)->ghostpads);
|
||||||
|
}
|
||||||
|
|
||||||
if (GTK_OBJECT_CLASS (real_pad_parent_class)->destroy)
|
if (GTK_OBJECT_CLASS (real_pad_parent_class)->destroy)
|
||||||
GTK_OBJECT_CLASS (real_pad_parent_class)->destroy (object);
|
GTK_OBJECT_CLASS (real_pad_parent_class)->destroy (object);
|
||||||
|
|
|
@ -142,7 +142,6 @@ gst_thread_init (GstThread *thread)
|
||||||
GST_FLAG_SET (thread, GST_THREAD_CREATE);
|
GST_FLAG_SET (thread, GST_THREAD_CREATE);
|
||||||
|
|
||||||
thread->lock = g_mutex_new();
|
thread->lock = g_mutex_new();
|
||||||
|
|
||||||
thread->cond = g_cond_new();
|
thread->cond = g_cond_new();
|
||||||
|
|
||||||
GST_ELEMENT_SCHED(thread) = gst_schedule_new(GST_ELEMENT(thread));
|
GST_ELEMENT_SCHED(thread) = gst_schedule_new(GST_ELEMENT(thread));
|
||||||
|
@ -161,8 +160,8 @@ 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_ELEMENT_SCHED(thread));
|
gst_object_destroy (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
|
||||||
gst_object_unref (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);
|
||||||
|
|
Loading…
Reference in a new issue