diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index df85c38e00..8ecc553db5 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -315,7 +315,9 @@ gst_elementfactory_add_padtemplate (GstElementFactory *factory, g_return_if_fail(templ != NULL); padtemplates = factory->padtemplates; - + + gst_object_ref (GST_OBJECT (templ)); + while (padtemplates) { GstPadTemplate *oldtempl = GST_PADTEMPLATE (padtemplates->data);