diff --git a/ChangeLog b/ChangeLog index 8380431cff..05e9aa1dfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-01-17 Andy Wingo + + * 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 * gst/gstbuffer.c: (gst_buffer_is_metadata_writable), diff --git a/gst/gstregistry.c b/gst/gstregistry.c index ff2c0e7a13..ecc210c11a 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -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); } diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 921793792d..2141894e67 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -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); }