[glib] Don't leak references to the menus



commit cc03b3cdea45b3592ab8e931628f027c20586aa3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Dec 24 23:01:17 2011 -0500

    Don't leak references to the menus

 gio/gmenumarkup.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/gmenumarkup.c b/gio/gmenumarkup.c
index 867487d..4cdd985 100644
--- a/gio/gmenumarkup.c
+++ b/gio/gmenumarkup.c
@@ -205,6 +205,7 @@ g_menu_markup_start_element (GMarkupParseContext  *context,
               if (state->objects)
                 g_hash_table_insert (state->objects, g_strdup (id), g_object_ref (menu));
             }
+          g_object_unref (menu);
 
           return;
         }
@@ -225,6 +226,7 @@ g_menu_markup_start_element (GMarkupParseContext  *context,
               if (state->objects)
                 g_hash_table_insert (state->objects, g_strdup (id), g_object_ref (menu));
             }
+          g_object_unref (menu);
 
           return;
         }
@@ -280,6 +282,7 @@ g_menu_markup_start_element (GMarkupParseContext  *context,
 
               if (id != NULL && state->objects)
                 g_hash_table_insert (state->objects, g_strdup (id), g_object_ref (menu));
+              g_object_unref (menu);
             }
 
           return;



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