diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2018-01-11 17:10:45 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-01-26 11:10:44 +0000 |
commit | af1cf061d764b4770bb307fc0d43b1a6c6c87ba6 (patch) | |
tree | f8c502eaeaf28df74e2c5a55dffd40e3d3069e79 | |
parent | b43f88fef6044aa77264a6f743fe681061de0974 (diff) | |
download | gstreamer-af1cf061d764b4770bb307fc0d43b1a6c6c87ba6.tar.gz |
plugin: plugin_load() must return a ref even if it was loaded already
Fix refcounting issue when plugin was loaded already.
gst_plugin_load() is supposed to return a ref, so it
must always return a ref.
This also fixes the gstplugin unit test on windows where
fork is not available and where test_load_coreelements()
would unref a plugin ref it didn't get and then mess up
the internal registry plugin list state for the next test,
in case where the test registry does not exist yet.
-rw-r--r-- | gst/gstplugin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 8b1a5cfac4..d973e86d98 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -1303,7 +1303,7 @@ gst_plugin_load (GstPlugin * plugin) GstPlugin *newplugin; if (gst_plugin_is_loaded (plugin)) { - return plugin; + return gst_object_ref (plugin); } if (!(newplugin = gst_plugin_load_file (plugin->filename, &error))) |