gst/gstevent.c: actually break; inside the switch statement
authorBenjamin Otte <otte@gnome.org>
Wed, 4 Feb 2004 17:24:23 +0000 (17:24 +0000)
committerBenjamin Otte <otte@gnome.org>
Wed, 4 Feb 2004 17:24:23 +0000 (17:24 +0000)
Original commit message from CVS:
2004-02-04  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* gst/gstevent.c: (_gst_event_free):
actually break; inside the switch statement
* gst/parse/grammar.y:
fix memleak where GValues weren't unset

ChangeLog
gst/gstevent.c
gst/parse/grammar.y

index 8c5b284..c246985 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-04  Benjamin Otte  <in7y118@public.uni-hamburg.de>
+
+       * 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  <in7y118@public.uni-hamburg.de>
 
        * gst/gststructure.c: (gst_structure_from_string):
index 22fb2b2..a3301e8 100644 (file)
@@ -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;
   }
index 29c9696..3732199 100644 (file)
@@ -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: