diff --git a/ChangeLog b/ChangeLog index 8c5b284312..c2469850e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-02-04 Benjamin Otte + + * gst/gstevent.c: (_gst_event_free): + actually break; inside the switch statement + * gst/parse/grammar.y: + fix memleak where GValues weren't unset + 2004-02-03 Benjamin Otte * gst/gststructure.c: (gst_structure_from_string): diff --git a/gst/gstevent.c b/gst/gstevent.c index 22fb2b2b94..a3301e8c9d 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -93,8 +93,10 @@ _gst_event_free (GstEvent* event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_TAG: gst_tag_list_free (event->event_data.structure.structure); + break; case GST_EVENT_NAVIGATION: gst_structure_free (event->event_data.structure.structure); + break; default: break; } diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 29c9696ab6..3732199de1 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -223,6 +223,8 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph) { GParamSpec *pspec; gchar *pos = value; + GValue v = { 0, }; + GValue v2 = { 0, }; /* parse the string, so the property name is null-terminated an pos points to the beginning of the value */ while (!g_ascii_isspace (*pos) && (*pos != '=')) pos++; @@ -241,8 +243,6 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph) } gst_parse_unescape (pos); if ((pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (element), value))) { - GValue v = { 0, }; - GValue v2 = { 0, }; g_value_init (&v, G_PARAM_SPEC_VALUE_TYPE(pspec)); switch (G_TYPE_FUNDAMENTAL (G_PARAM_SPEC_VALUE_TYPE (pspec))) { case G_TYPE_STRING: @@ -320,6 +320,10 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph) out: gst_parse_strfree (value); + if (G_IS_VALUE (&v)) + g_value_unset (&v); + if (G_IS_VALUE (&v2)) + g_value_unset (&v2); return; error: