+2005-11-30 Edward Hervey <edward@fluendo.com>
+
+ * gst/gsttypefind.c: (gst_type_find_register):
+ * gst/gsttypefind.h:
+ * gst/gsttypefindfactory.c: (gst_type_find_factory_init),
+ (gst_type_find_factory_dispose):
+ * gst/gsttypefindfactory.h:
+ Fix memory leak in GstTypeFindFactory.
+
2005-11-29 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* gst/gst.c:
-Subproject commit 33084fbe0531733bc02aa1d9de608206d5553a15
+Subproject commit 8db4c613eb1aa57dc21d25a4b83b36e3cdedc5ca
* @possible_caps: Optionally the caps that could be returned when typefinding succeeds
* @data: Optional user data. This user data must be available until the plugin
* is unloaded.
+ * @data_notify: a #GDestroyNotify that will be called on @data when the plugin
+ * is unloaded.
*
* Registers a new typefind function to be used for typefinding. After
* registering this function will be available for typefinding.
gboolean
gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank,
GstTypeFindFunction func, gchar ** extensions,
- const GstCaps * possible_caps, gpointer data)
+ const GstCaps * possible_caps, gpointer data, GDestroyNotify data_notify)
{
GstTypeFindFactory *factory;
gst_caps_replace (&factory->caps, (GstCaps *) possible_caps);
factory->function = func;
factory->user_data = data;
+ factory->user_data_notify = data_notify;
GST_PLUGIN_FEATURE (factory)->plugin_name = g_strdup (plugin->desc.name);
GST_PLUGIN_FEATURE (factory)->loaded = TRUE;
GstTypeFindFunction func,
gchar ** extensions,
const GstCaps * possible_caps,
- gpointer data);
+ gpointer data,
+ GDestroyNotify data_notify);
G_END_DECLS
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (instance);
factory->user_data = factory;
+ factory->user_data_notify = NULL;
}
static void
g_strfreev (factory->extensions);
factory->extensions = NULL;
}
+ if (factory->user_data_notify && factory->user_data) {
+ factory->user_data_notify (factory->user_data);
+ factory->user_data = NULL;
+ }
}
/**
GstCaps * caps; /* FIXME: not yet saved in registry */
gpointer user_data;
+ GDestroyNotify user_data_notify;
gpointer _gst_reserved[GST_PADDING];
};