mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 13:02:29 +00:00
element: Enforce that elements created by gst_element_factory_create/make() are floating
Bindings might have a hard time making sure that the reference is indeed still floating after returning here. See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
This commit is contained in:
parent
341ee45155
commit
9cf764b2ec
1 changed files with 6 additions and 0 deletions
|
@ -386,6 +386,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;
|
||||
|
|
Loading…
Reference in a new issue