[gimp] app: unparent GimpDockBook's menu button in dispose() not finalize()



commit 1459f5bb612124051db640d63122a9b305b4f2bc
Author: Michael Natterer <mitch gimp org>
Date:   Tue Oct 4 23:51:54 2011 +0200

    app: unparent GimpDockBook's menu button in dispose() not finalize()
    
    because unparenting requires a fully functional object that can
    be used as signal parameter. I have no clue why this doesn't
    trigger criticals on X11.

 app/widgets/gimpdockbook.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c
index bf47c16..b15be5c 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -312,6 +312,12 @@ gimp_dockbook_dispose (GObject *object)
   while (dockbook->p->dockables)
     gimp_dockbook_remove (dockbook, dockbook->p->dockables->data);
 
+  if (dockbook->p->menu_button)
+    {
+      gtk_widget_unparent (dockbook->p->menu_button);
+      dockbook->p->menu_button = NULL;
+    }
+
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
@@ -326,12 +332,6 @@ gimp_dockbook_finalize (GObject *object)
       dockbook->p->ui_manager = NULL;
     }
 
-    if (dockbook->p->menu_button)
-    {
-      gtk_widget_unparent (dockbook->p->menu_button);
-      dockbook->p->menu_button = NULL;
-    }
-
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 



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