mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-28 14:52:24 +00:00
Fix #109724, refcounting on padtemplates
Original commit message from CVS: Fix #109724, refcounting on padtemplates
This commit is contained in:
parent
861c94ed3f
commit
f73fac3d8a
1 changed files with 18 additions and 15 deletions
|
@ -112,6 +112,7 @@ gst_element_details_free (GstElementDetails *dp)
|
|||
{
|
||||
g_free (dp->longname);
|
||||
g_free (dp->klass);
|
||||
g_free (dp->license);
|
||||
g_free (dp->description);
|
||||
g_free (dp->version);
|
||||
g_free (dp->author);
|
||||
|
@ -122,11 +123,27 @@ gst_element_details_free (GstElementDetails *dp)
|
|||
static void
|
||||
gst_element_factory_cleanup (GstElementFactory *factory)
|
||||
{
|
||||
GList *padtemplates;
|
||||
|
||||
if (factory->details_dynamic) {
|
||||
gst_element_details_free (factory->details);
|
||||
factory->details_dynamic = FALSE;
|
||||
}
|
||||
|
||||
padtemplates = factory->padtemplates;
|
||||
|
||||
while (padtemplates) {
|
||||
GstPadTemplate *oldtempl = GST_PAD_TEMPLATE (padtemplates->data);
|
||||
|
||||
gst_object_unref (GST_OBJECT (oldtempl));
|
||||
|
||||
padtemplates = g_list_next (padtemplates);
|
||||
}
|
||||
g_list_free (factory->padtemplates);
|
||||
|
||||
factory->padtemplates = NULL;
|
||||
factory->numpadtemplates = 0;
|
||||
|
||||
g_free (GST_PLUGIN_FEATURE (factory)->name);
|
||||
}
|
||||
|
||||
|
@ -303,26 +320,12 @@ void
|
|||
gst_element_factory_add_pad_template (GstElementFactory *factory,
|
||||
GstPadTemplate *templ)
|
||||
{
|
||||
GList *padtemplates;
|
||||
|
||||
g_return_if_fail (factory != NULL);
|
||||
g_return_if_fail (templ != NULL);
|
||||
|
||||
padtemplates = factory->padtemplates;
|
||||
|
||||
gst_object_ref (GST_OBJECT (templ));
|
||||
gst_object_sink (GST_OBJECT (templ));
|
||||
|
||||
while (padtemplates) {
|
||||
GstPadTemplate *oldtempl = GST_PAD_TEMPLATE (padtemplates->data);
|
||||
|
||||
if (!strcmp (oldtempl->name_template, templ->name_template)) {
|
||||
gst_object_unref (GST_OBJECT (oldtempl));
|
||||
padtemplates->data = templ;
|
||||
return;
|
||||
}
|
||||
|
||||
padtemplates = g_list_next (padtemplates);
|
||||
}
|
||||
factory->padtemplates = g_list_append (factory->padtemplates, templ);
|
||||
factory->numpadtemplates++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue