mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
plug another memleak in registry loading - I have NO idea why this was returning a GstPlugin
Original commit message from CVS: plug another memleak in registry loading - I have NO idea why this was returning a GstPlugin
This commit is contained in:
parent
34445bec34
commit
c527fd8dad
2 changed files with 19 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-07-08 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* gst/registries/gstlibxmlregistry.c: (read_string), (load_paths),
|
||||||
|
(gst_xml_registry_load):
|
||||||
|
plug another memleak
|
||||||
|
|
||||||
2005-07-08 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-07-08 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -573,6 +573,11 @@ add_to_char_array (gchar *** array, gchar * value)
|
||||||
*array = new;
|
*array = new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* read a string and store the result in *write_to.
|
||||||
|
* return whether or not *write_to was set to a newly allocated string
|
||||||
|
* FIXME: return values aren't actually checked, and in those failure cases
|
||||||
|
* (that currently aren't triggered) cleanup is not done correctly
|
||||||
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
read_string (xmlTextReaderPtr reader, gchar ** write_to)
|
read_string (xmlTextReaderPtr reader, gchar ** write_to)
|
||||||
{
|
{
|
||||||
|
@ -585,12 +590,14 @@ read_string (xmlTextReaderPtr reader, gchar ** write_to)
|
||||||
if (xmlTextReaderDepth (reader) == depth)
|
if (xmlTextReaderDepth (reader) == depth)
|
||||||
return found;
|
return found;
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_TEXT) {
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_TEXT) {
|
||||||
if (found)
|
if (found) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
*write_to = g_strdup ((gchar *) xmlTextReaderConstValue (reader));
|
*write_to = g_strdup ((gchar *) xmlTextReaderConstValue (reader));
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,15 +857,14 @@ load_plugin (xmlTextReaderPtr reader)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPlugin *
|
static void
|
||||||
load_paths (xmlTextReaderPtr reader, GstXMLRegistry * registry)
|
load_paths (xmlTextReaderPtr reader, GstXMLRegistry * registry)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
GstPlugin *plugin = g_new0 (GstPlugin, 1);
|
|
||||||
|
|
||||||
while ((ret = xmlTextReaderRead (reader)) == 1) {
|
while ((ret = xmlTextReaderRead (reader)) == 1) {
|
||||||
if (xmlTextReaderDepth (reader) == 1) {
|
if (xmlTextReaderDepth (reader) == 1) {
|
||||||
return plugin;
|
return;
|
||||||
}
|
}
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
||||||
xmlTextReaderDepth (reader) == 2) {
|
xmlTextReaderDepth (reader) == 2) {
|
||||||
|
@ -876,8 +882,7 @@ load_paths (xmlTextReaderPtr reader, GstXMLRegistry * registry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (plugin);
|
return;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -925,7 +930,8 @@ gst_xml_registry_load (GstRegistry * registry)
|
||||||
GstPlugin *plugin = load_plugin (reader);
|
GstPlugin *plugin = load_plugin (reader);
|
||||||
|
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
GST_DEBUG ("adding plugin %s with %d features", plugin->desc.name,
|
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING,
|
||||||
|
"adding plugin %s with %d features", plugin->desc.name,
|
||||||
plugin->numfeatures);
|
plugin->numfeatures);
|
||||||
gst_registry_add_plugin (GST_REGISTRY (xmlregistry), plugin);
|
gst_registry_add_plugin (GST_REGISTRY (xmlregistry), plugin);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue