gst/gstindex.c: get refcounting correct.
authorDavid Schleef <ds@schleef.org>
Fri, 16 Sep 2005 00:02:27 +0000 (00:02 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 16 Sep 2005 00:02:27 +0000 (00:02 +0000)
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
gst/gstindex.c
gst/gstregistry.c

index 5d4a445..d62cfa9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-09-15  David Schleef  <ds@schleef.org>
 
+       * gst/gstindex.c: get refcounting correct.
+       * gst/gstregistry.c: Handle the case where a feature/plugin is
+         not found.
+
+2005-09-15  David Schleef  <ds@schleef.org>
+
        * check/Makefile.am:
        * check/gst/gstplugin.c: Add test
        * gst/gstplugin.c: Fix problems noticed by testsuite
index 983d03e..1ddd0b0 100644 (file)
@@ -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)
index 286b439..ef8328b 100644 (file)
@@ -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;
 }