[gnome-menus/wip/gobject-review] libmenu: Dispose of source before context to avoid possible double unref



commit 08c7a276c5667717a719885db656acef694ef253
Author: Colin Walters <walters verbum org>
Date:   Tue Jun 14 13:52:06 2011 -0400

    libmenu: Dispose of source before context to avoid possible double unref

 libmenu/menu-layout.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libmenu/menu-layout.c b/libmenu/menu-layout.c
index 2c88518..4b2a02c 100644
--- a/libmenu/menu-layout.c
+++ b/libmenu/menu-layout.c
@@ -247,14 +247,14 @@ menu_layout_node_unref (MenuLayoutNode *node)
           g_slist_foreach (nr->monitors, (GFunc) g_free, NULL);
           g_slist_free (nr->monitors);
 
-          if (nr->main_context != NULL)
-            g_main_context_unref (nr->main_context);
-          nr->main_context = NULL;
-
           if (nr->monitors_idle_handler != NULL)
             g_source_destroy (nr->monitors_idle_handler);
           nr->monitors_idle_handler = NULL;
 
+          if (nr->main_context != NULL)
+            g_main_context_unref (nr->main_context);
+          nr->main_context = NULL;
+
           g_free (nr->basedir);
           g_free (nr->name);
         }



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