X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstelementfactory.c;h=b538613d29569d4153b4ca2b989ba98cf5d3e69f;hb=refs%2Fchanges%2F76%2F222676%2F2;hp=4caa310fa2ae0cbfe384cb2eef8e76ab3e6e46db;hpb=214d0b087667889188534f5d3190bf547cebffbf;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 4caa310..b538613 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -391,6 +391,12 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name) /* This ref will never be dropped as the class is never destroyed */ GST_OBJECT_FLAG_SET (factory, GST_OBJECT_FLAG_MAY_BE_LEAKED); + /* Ensure that the reference is floating. Bindings might have a hard time + * making sure that the reference is indeed still floating after returning + * here */ + if (element) + g_object_force_floating ((GObject *) element); + GST_DEBUG ("created element \"%s\"", GST_OBJECT_NAME (factory)); return element; @@ -514,6 +520,8 @@ const gchar * gst_element_factory_get_metadata (GstElementFactory * factory, const gchar * key) { + g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL); + return gst_structure_get_string ((GstStructure *) factory->metadata, key); }