mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
gst/gstregistry.c (_gst_registry_remove_cache_plugins): Lock the registry while we remove plugins.
Original commit message from CVS: 2006-01-17 Andy Wingo <wingo@pobox.com> * gst/gstregistry.c (_gst_registry_remove_cache_plugins): Lock the registry while we remove plugins. * tools/gst-inspect.c (print_element_info): Don't unref the factory arg, that should be the responsibility of whatever code received the ref. Fixes a double-free when called from print_element_list via gst-inspect-0.10 -a. Fixes #327324. (main): Unref the factory if we have one. (print_element_list): No change -- relies on the plugin_feature_list_free to free the list of features.
This commit is contained in:
parent
0c0d5462a2
commit
77cb34fd81
3 changed files with 21 additions and 2 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2006-01-17 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* gst/gstregistry.c (_gst_registry_remove_cache_plugins): Lock the
|
||||
registry while we remove plugins.
|
||||
|
||||
* tools/gst-inspect.c (print_element_info): Don't unref the
|
||||
factory arg, that should be the responsibility of whatever code
|
||||
received the ref. Fixes a double-free when called from
|
||||
print_element_list via gst-inspect-0.10 -a. Fixes #327324.
|
||||
(main): Unref the factory if we have one.
|
||||
(print_element_list): No change -- relies on the
|
||||
plugin_feature_list_free to free the list of features.
|
||||
|
||||
2006-01-17 Jan Schmidt <thaytan@mad.scientist.com>
|
||||
|
||||
* gst/gstbuffer.c: (gst_buffer_is_metadata_writable),
|
||||
|
|
|
@ -855,6 +855,8 @@ _gst_registry_remove_cache_plugins (GstRegistry * registry)
|
|||
|
||||
g_return_if_fail (GST_IS_REGISTRY (registry));
|
||||
|
||||
GST_OBJECT_LOCK (registry);
|
||||
|
||||
GST_DEBUG_OBJECT (registry, "removing cached plugins");
|
||||
g = registry->plugins;
|
||||
while (g) {
|
||||
|
@ -863,11 +865,16 @@ _gst_registry_remove_cache_plugins (GstRegistry * registry)
|
|||
if (plugin->flags & GST_PLUGIN_FLAG_CACHED) {
|
||||
GST_DEBUG_OBJECT (registry, "removing cached plugin \"%s\"",
|
||||
GST_STR_NULL (plugin->filename));
|
||||
/* seems it would be sufficient just to do a delete_link for o(1) deletion
|
||||
* -- we have to traverse the whole list anyway, and dup entries (if
|
||||
* possible) should have dup refcounts */
|
||||
registry->plugins = g_list_remove (registry->plugins, plugin);
|
||||
gst_object_unref (plugin);
|
||||
}
|
||||
g = g_next;
|
||||
}
|
||||
|
||||
GST_OBJECT_UNLOCK (registry);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1093,8 +1093,6 @@ print_element_info (GstElementFactory * factory, gboolean print_names)
|
|||
print_signal_info (element);
|
||||
print_children_info (element);
|
||||
|
||||
gst_object_unref (factory);
|
||||
|
||||
if (_name[0] != '\0')
|
||||
g_free (_name);
|
||||
|
||||
|
@ -1147,6 +1145,7 @@ main (int argc, char *argv[])
|
|||
/* if there's a factory, print out the info */
|
||||
if (factory) {
|
||||
retval = print_element_info (factory, print_all);
|
||||
gst_object_unref (factory);
|
||||
} else {
|
||||
retval = print_element_features (arg);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue