mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
gst/gstregistryxml.c: Cleanups.
Original commit message from CVS: * gst/gstregistryxml.c: (load_feature): Cleanups. Don't use g_object_unref on GstObjects so that we avoid leaks on unsafe glibs.
This commit is contained in:
parent
0a12d6a308
commit
ab0fa35575
2 changed files with 19 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-12-16 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst/gstregistryxml.c: (load_feature):
|
||||||
|
Cleanups.
|
||||||
|
Don't use g_object_unref on GstObjects so that we avoid
|
||||||
|
leaks on unsafe glibs.
|
||||||
|
|
||||||
2005-12-16 Wim Taymans <wim@fluendo.com>
|
2005-12-16 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/gstbin.c: (gst_bin_recalc_state):
|
* gst/gstbin.c: (gst_bin_recalc_state):
|
||||||
|
|
|
@ -218,16 +218,20 @@ static GstPluginFeature *
|
||||||
load_feature (xmlTextReaderPtr reader)
|
load_feature (xmlTextReaderPtr reader)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int depth = xmlTextReaderDepth (reader);
|
int depth;
|
||||||
gchar *feature_name =
|
gchar *feature_name;
|
||||||
(gchar *) xmlTextReaderGetAttribute (reader, BAD_CAST "typename");
|
|
||||||
GstPluginFeature *feature;
|
GstPluginFeature *feature;
|
||||||
GType type;
|
GType type;
|
||||||
|
|
||||||
|
depth = xmlTextReaderDepth (reader);
|
||||||
|
feature_name =
|
||||||
|
(gchar *) xmlTextReaderGetAttribute (reader, BAD_CAST "typename");
|
||||||
|
|
||||||
GST_DEBUG ("loading feature");
|
GST_DEBUG ("loading feature");
|
||||||
|
|
||||||
if (!feature_name)
|
if (!feature_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
type = g_type_from_name (feature_name);
|
type = g_type_from_name (feature_name);
|
||||||
g_free (feature_name);
|
g_free (feature_name);
|
||||||
feature_name = NULL;
|
feature_name = NULL;
|
||||||
|
@ -240,7 +244,11 @@ load_feature (xmlTextReaderPtr reader)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!GST_IS_PLUGIN_FEATURE (feature)) {
|
if (!GST_IS_PLUGIN_FEATURE (feature)) {
|
||||||
g_object_unref (feature);
|
/* don't really know what it is */
|
||||||
|
if (GST_IS_OBJECT (feature))
|
||||||
|
gst_object_unref (feature);
|
||||||
|
else
|
||||||
|
g_object_unref (feature);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
while ((ret = xmlTextReaderRead (reader)) == 1) {
|
while ((ret = xmlTextReaderRead (reader)) == 1) {
|
||||||
|
|
Loading…
Reference in a new issue