mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
deviceproviderfactory: fix factory leak
The code path when early returning was leaking the extra reference on the factory. https://bugzilla.gnome.org/show_bug.cgi?id=765904
This commit is contained in:
parent
c7bb52934e
commit
782bc97e6f
1 changed files with 3 additions and 1 deletions
|
@ -275,8 +275,10 @@ gst_device_provider_factory_get (GstDeviceProviderFactory * factory)
|
||||||
goto no_type;
|
goto no_type;
|
||||||
|
|
||||||
device_provider = g_atomic_pointer_get (&newfactory->provider);
|
device_provider = g_atomic_pointer_get (&newfactory->provider);
|
||||||
if (device_provider)
|
if (device_provider) {
|
||||||
|
gst_object_unref (factory);
|
||||||
return gst_object_ref (device_provider);
|
return gst_object_ref (device_provider);
|
||||||
|
}
|
||||||
|
|
||||||
/* create an instance of the device provider, cast so we don't assert on NULL
|
/* create an instance of the device provider, cast so we don't assert on NULL
|
||||||
* also set name as early as we can
|
* also set name as early as we can
|
||||||
|
|
Loading…
Reference in a new issue