From 107444fe44db38be2a00e48ef0e8b63c0258aa94 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 16 Sep 2005 00:02:27 +0000 Subject: [PATCH] gst/gstindex.c: get refcounting correct. Original commit message from CVS: * gst/gstindex.c: get refcounting correct. * gst/gstregistry.c: Handle the case where a feature/plugin is not found. --- ChangeLog | 6 ++++++ gst/gstindex.c | 5 +---- gst/gstregistry.c | 14 ++++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d4a445..d62cfa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-09-15 David Schleef + * gst/gstindex.c: get refcounting correct. + * gst/gstregistry.c: Handle the case where a feature/plugin is + not found. + +2005-09-15 David Schleef + * check/Makefile.am: * check/gst/gstplugin.c: Add test * gst/gstplugin.c: Fix problems noticed by testsuite diff --git a/gst/gstindex.c b/gst/gstindex.c index 983d03e..1ddd0b0 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -914,10 +914,7 @@ gst_index_factory_new (const gchar * name, const gchar * longdesc, GType type) GstIndexFactory *factory; g_return_val_if_fail (name != NULL, NULL); - factory = gst_index_factory_find (name); - if (!factory) { - factory = GST_INDEX_FACTORY (g_object_new (GST_TYPE_INDEX_FACTORY, NULL)); - } + factory = GST_INDEX_FACTORY (g_object_new (GST_TYPE_INDEX_FACTORY, NULL)); GST_PLUGIN_FEATURE_NAME (factory) = g_strdup (name); if (factory->longdesc) diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 286b439..ef8328b 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -354,11 +354,12 @@ gst_registry_find_plugin (GstRegistry * registry, const gchar * name) walk = gst_registry_plugin_filter (registry, (GstPluginFilter) gst_plugin_name_filter, TRUE, (gpointer) name); - if (walk) + if (walk) { result = GST_PLUGIN (walk->data); - gst_object_ref (result); - gst_plugin_list_free (walk); + gst_object_ref (result); + gst_plugin_list_free (walk); + } return result; } @@ -392,11 +393,12 @@ gst_registry_find_feature (GstRegistry * registry, const gchar * name, (GstPluginFeatureFilter) gst_plugin_feature_type_name_filter, TRUE, &data); - if (walk) + if (walk) { feature = GST_PLUGIN_FEATURE (walk->data); - gst_object_ref (feature->plugin); - gst_plugin_feature_list_free (walk); + gst_object_ref (feature->plugin); + gst_plugin_feature_list_free (walk); + } return feature; } -- 2.7.4