mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-13 03:46:34 +00:00
Fixed a leak in bin destruction
Original commit message from CVS: Fixed a leak in bin destruction More refcounting fixes
This commit is contained in:
parent
12cfd1842c
commit
6f9ac3667b
5 changed files with 11 additions and 5 deletions
|
@ -500,16 +500,20 @@ gst_bin_real_destroy (GtkObject *object)
|
||||||
GList *children;
|
GList *children;
|
||||||
GstElement *child;
|
GstElement *child;
|
||||||
|
|
||||||
GST_DEBUG (0,"in gst_bin_real_destroy()\n");
|
GST_DEBUG (GST_CAT_REFCOUNTING,"destroy()\n");
|
||||||
|
|
||||||
children = bin->children;
|
children = bin->children;
|
||||||
while (children) {
|
while (children) {
|
||||||
child = GST_ELEMENT (children->data);
|
child = GST_ELEMENT (children->data);
|
||||||
gst_element_destroy (child);
|
gst_object_unref (GST_OBJECT (child));
|
||||||
children = g_list_next (children);
|
children = g_list_next (children);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (bin->children);
|
g_list_free (bin->children);
|
||||||
|
bin->children = NULL;
|
||||||
|
bin->numchildren = 0;
|
||||||
|
|
||||||
|
g_cond_free (bin->eoscond);
|
||||||
|
|
||||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||||
|
|
|
@ -894,6 +894,9 @@ gst_element_real_destroy (GtkObject *object)
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (element->pads);
|
g_list_free (element->pads);
|
||||||
|
element->pads = NULL;
|
||||||
|
element->numsrcpads = 0;
|
||||||
|
element->numsinkpads = 0;
|
||||||
|
|
||||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||||
|
|
|
@ -161,7 +161,6 @@ gst_elementfactory_create (GstElementFactory *factory,
|
||||||
// create an instance of the element
|
// create an instance of the element
|
||||||
element = GST_ELEMENT(gtk_type_new(factory->type));
|
element = GST_ELEMENT(gtk_type_new(factory->type));
|
||||||
g_assert(element != NULL);
|
g_assert(element != NULL);
|
||||||
gst_object_ref(GST_OBJECT(element));
|
|
||||||
|
|
||||||
// attempt to set the elemenfactory class pointer if necessary
|
// attempt to set the elemenfactory class pointer if necessary
|
||||||
oclass = GST_ELEMENT_CLASS(GTK_OBJECT(element)->klass);
|
oclass = GST_ELEMENT_CLASS(GTK_OBJECT(element)->klass);
|
||||||
|
|
|
@ -200,7 +200,7 @@ gst_thread_get_arg (GtkObject *object,
|
||||||
* Returns: The new thread
|
* Returns: The new thread
|
||||||
*/
|
*/
|
||||||
GstElement*
|
GstElement*
|
||||||
gst_thread_new (guchar *name)
|
gst_thread_new (const guchar *name)
|
||||||
{
|
{
|
||||||
return gst_elementfactory_make ("thread", name);
|
return gst_elementfactory_make ("thread", name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct _GstThreadClass {
|
||||||
|
|
||||||
GtkType gst_thread_get_type (void);
|
GtkType gst_thread_get_type (void);
|
||||||
|
|
||||||
GstElement* gst_thread_new (guchar *name);
|
GstElement* gst_thread_new (const guchar *name);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue