don't free the linkbase on reconfigure
authorDana Jansens <danakj@orodu.net>
Tue, 25 Jan 2011 18:40:56 +0000 (13:40 -0500)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:54:04 +0000 (18:54 -0400)
the menu does get freed, so don't free it with the menu.

openbox/apps_menu.c

index d46ba6ed8b81ba1c03144c295f69579306fc6414..7e5fb709ae8f416cc70e8359b0624c1b184e7eb3 100644 (file)
@@ -35,12 +35,6 @@ static ObMenu *apps_menu;
 static ObtLinkBase *linkbase;
 static gboolean dirty;
 
-static void self_destroy(ObMenu *menu, gpointer data)
-{
-    obt_linkbase_unref(linkbase);
-    linkbase = NULL;
-}
-
 static void self_cleanup(ObMenu *menu, gpointer data)
 {
     menu_clear_entries(menu);
@@ -111,10 +105,14 @@ void apps_menu_startup(gboolean reconfig)
     menu_set_update_func(apps_menu, self_update);
     menu_set_cleanup_func(apps_menu, self_cleanup);
     menu_set_execute_func(apps_menu, menu_execute);
-    menu_set_destroy_func(apps_menu, self_destroy);
 }
 
 void apps_menu_shutdown(gboolean reconfig)
 {
+    if (!reconfig) {
+        obt_linkbase_unref(linkbase);
+        linkbase = NULL;
+    }
+
     /* freed by the hash table */
 }