Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
luzpaz
gstreamer
Commits
4b880282
Commit
4b880282
authored
Sep 13, 2001
by
Joshua N. Pritikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leaks
Original commit message from CVS: fix memory leaks
parent
4b447f44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
26 deletions
+53
-26
gst/gstelement.c
gst/gstelement.c
+4
-4
gst/gstelement.h
gst/gstelement.h
+2
-0
gst/gstelementfactory.c
gst/gstelementfactory.c
+46
-21
gst/gstpad.c
gst/gstpad.c
+1
-1
No files found.
gst/gstelement.c
View file @
4b880282
...
...
@@ -1113,9 +1113,9 @@ gst_element_restore_thyself (xmlNodePtr self, GstObject *parent)
// first get the needed tags to construct the element
while
(
children
)
{
if
(
!
strcmp
(
children
->
name
,
"name"
))
{
name
=
g_strdup
(
xmlNodeGetContent
(
children
)
)
;
name
=
xmlNodeGetContent
(
children
);
}
else
if
(
!
strcmp
(
children
->
name
,
"type"
))
{
type
=
g_strdup
(
xmlNodeGetContent
(
children
)
)
;
type
=
xmlNodeGetContent
(
children
);
}
children
=
children
->
next
;
}
...
...
@@ -1142,10 +1142,10 @@ gst_element_restore_thyself (xmlNodePtr self, GstObject *parent)
while
(
child
)
{
if
(
!
strcmp
(
child
->
name
,
"name"
))
{
name
=
g_strdup
(
xmlNodeGetContent
(
child
)
)
;
name
=
xmlNodeGetContent
(
child
);
}
else
if
(
!
strcmp
(
child
->
name
,
"value"
))
{
value
=
g_strdup
(
xmlNodeGetContent
(
child
)
)
;
value
=
xmlNodeGetContent
(
child
);
}
child
=
child
->
next
;
}
...
...
gst/gstelement.h
View file @
4b880282
...
...
@@ -262,6 +262,8 @@ struct _GstElementFactory {
GType
type
;
/* unique GType of element */
guint
details_dynamic
:
1
;
GstElementDetails
*
details
;
/* pointer to details struct */
GList
*
padtemplates
;
...
...
gst/gstelementfactory.c
View file @
4b880282
...
...
@@ -138,6 +138,25 @@ gst_elementfactory_get_list (void)
return
_gst_elementfactories
;
}
static
void
gst_element_details_free
(
GstElementDetails
*
dp
)
{
g_return_if_fail
(
dp
);
if
(
dp
->
longname
)
g_free
(
dp
->
longname
);
if
(
dp
->
klass
)
g_free
(
dp
->
klass
);
if
(
dp
->
description
)
g_free
(
dp
->
description
);
if
(
dp
->
version
)
g_free
(
dp
->
version
);
if
(
dp
->
author
)
g_free
(
dp
->
author
);
if
(
dp
->
copyright
)
g_free
(
dp
->
copyright
);
g_free
(
dp
);
}
/**
* gst_elementfactory_new:
...
...
@@ -158,29 +177,27 @@ gst_elementfactory_new (const gchar *name, GType type,
g_return_val_if_fail
(
name
!=
NULL
,
NULL
);
g_return_val_if_fail
(
type
!=
0
,
NULL
);
g_return_val_if_fail
(
details
,
NULL
);
factory
=
gst_elementfactory_find
(
name
);
if
(
factory
)
{
if
(
!
type
)
g_warning
(
"gst_elementfactory_new for `%s' still didn't set type"
,
name
);
if
(
!
factory
)
factory
=
GST_ELEMENTFACTORY
(
g_object_new
(
GST_TYPE_ELEMENTFACTORY
,
NULL
));
if
(
!
factory
->
type
)
factory
->
type
=
type
;
else
if
(
factory
->
type
!=
type
)
g_critical
(
"%s type changed"
,
name
);
return
factory
;
if
(
factory
->
details_dynamic
)
{
gst_element_details_free
(
factory
->
details
);
factory
->
details_dynamic
=
FALSE
;
}
// probably created by the registry
factory
=
GST_ELEMENTFACTORY
(
g_object_new
(
GST_TYPE_ELEMENTFACTORY
,
NULL
));
factory
->
details
=
details
;
if
(
!
factory
->
type
)
factory
->
type
=
type
;
else
if
(
factory
->
type
!=
type
)
g_critical
(
"`%s' requested type change (!)"
,
name
);
gst_object_set_name
(
GST_OBJECT
(
factory
),
name
);
factory
->
type
=
type
;
factory
->
details
=
details
;
return
factory
;
}
...
...
@@ -400,12 +417,18 @@ gst_elementfactory_save_thyself (GstObject *object,
g_return_val_if_fail
(
factory
!=
NULL
,
NULL
);
xmlNewChild
(
parent
,
NULL
,
"longname"
,
factory
->
details
->
longname
);
xmlNewChild
(
parent
,
NULL
,
"class"
,
factory
->
details
->
klass
);
xmlNewChild
(
parent
,
NULL
,
"description"
,
factory
->
details
->
description
);
xmlNewChild
(
parent
,
NULL
,
"version"
,
factory
->
details
->
version
);
xmlNewChild
(
parent
,
NULL
,
"author"
,
factory
->
details
->
author
);
xmlNewChild
(
parent
,
NULL
,
"copyright"
,
factory
->
details
->
copyright
);
if
(
factory
->
details
)
{
xmlNewChild
(
parent
,
NULL
,
"longname"
,
factory
->
details
->
longname
);
xmlNewChild
(
parent
,
NULL
,
"class"
,
factory
->
details
->
klass
);
xmlNewChild
(
parent
,
NULL
,
"description"
,
factory
->
details
->
description
);
xmlNewChild
(
parent
,
NULL
,
"version"
,
factory
->
details
->
version
);
xmlNewChild
(
parent
,
NULL
,
"author"
,
factory
->
details
->
author
);
xmlNewChild
(
parent
,
NULL
,
"copyright"
,
factory
->
details
->
copyright
);
}
else
g_warning
(
"elementfactory `%s' is missing details"
,
object
->
name
);
pads
=
factory
->
padtemplates
;
if
(
pads
)
{
...
...
@@ -427,6 +450,8 @@ gst_elementfactory_restore_thyself (GstObject *object, xmlNodePtr parent)
{
GstElementFactory
*
factory
=
GST_ELEMENTFACTORY
(
object
);
xmlNodePtr
children
=
parent
->
xmlChildrenNode
;
factory
->
details_dynamic
=
TRUE
;
factory
->
details
=
g_new0
(
GstElementDetails
,
1
);
factory
->
padtemplates
=
NULL
;
...
...
gst/gstpad.c
View file @
4b880282
...
...
@@ -1059,7 +1059,7 @@ gst_pad_load_and_connect (xmlNodePtr self,
pad
=
gst_element_get_pad
(
GST_ELEMENT
(
parent
),
xmlNodeGetContent
(
field
));
}
else
if
(
!
strcmp
(
field
->
name
,
"peer"
))
{
peer
=
g_strdup
(
xmlNodeGetContent
(
field
)
)
;
peer
=
xmlNodeGetContent
(
field
);
}
field
=
field
->
next
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment