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.
This commit is contained in:
David Schleef 2005-09-16 00:02:27 +00:00
parent c43514eb59
commit 107444fe44
3 changed files with 15 additions and 10 deletions

View file

@ -1,3 +1,9 @@
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:

View 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)

View 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;
}