[glib/wip/menus: 44/61] GMenuModel: fix 3 memory leaks



commit e74425eb7647dc6735c4e35abd2f7045ddd0482e
Author: Ryan Lortie <desrt desrt ca>
Date:   Sat Oct 22 19:03:31 2011 -0400

    GMenuModel: fix 3 memory leaks
    
    A matching pair in the markup printer and one in the testcase.

 gio/gmenumarkup.c      |    3 +++
 gio/tests/gmenumodel.c |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gio/gmenumarkup.c b/gio/gmenumarkup.c
index fa589bf..8352be9 100644
--- a/gio/gmenumarkup.c
+++ b/gio/gmenumarkup.c
@@ -532,6 +532,8 @@ g_menu_markup_print_string (GString    *string,
               g_free (printed);
               g_free (str);
             }
+
+          g_variant_unref (value);
         }
       g_object_unref (attr_iter);
 
@@ -553,6 +555,7 @@ g_menu_markup_print_string (GString    *string,
 
           indent_string (contents, indent + tabstop);
           g_string_append (contents, "</link>\n");
+          g_object_unref (menu);
         }
       g_object_unref (link_iter);
 
diff --git a/gio/tests/gmenumodel.c b/gio/tests/gmenumodel.c
index 96e0c0e..77bbaa2 100644
--- a/gio/tests/gmenumodel.c
+++ b/gio/tests/gmenumodel.c
@@ -609,6 +609,7 @@ test_roundtrip (void)
   g_object_unref (state.proxy);
   g_menu_exporter_stop (G_MENU_MODEL (state.random));
   g_object_unref (state.random);
+  g_rand_free (state.rand);
   g_object_unref (bus);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]