]> git.eshelyaron.com Git - emacs.git/commitdiff
(free_frame_tool_bar): Only call gtk_container_remove if
authorJan Djärv <jan.h.d@swipnet.se>
Mon, 17 Mar 2008 07:18:57 +0000 (07:18 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Mon, 17 Mar 2008 07:18:57 +0000 (07:18 +0000)
handlebox_widget is != 0.

src/ChangeLog
src/gtkutil.c

index 7bddd0a326fbfd91131f3baad53940b82f7ed23a..42272453d813edb0290e88269d69e3e44c08cdb3 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-17  Jan Dj\e$(Q)Z\e(Brv  <jan.h.d@swipnet.se>
+
+       * gtkutil.c (free_frame_tool_bar): Only call gtk_container_remove if
+       handlebox_widget is != 0.
+
 2008-03-16  Juri Linkov  <juri@jurta.org>
 
        * callint.c (Fcall_interactively): For interactive code letters
index 03cc1c24b757286b89986037bb25f0f8bf3ca57a..0881f5bdd5e5f41ac7efbba14cba79b0c5d0ecce 100644 (file)
@@ -4139,9 +4139,16 @@ free_frame_tool_bar (f)
 
   if (x->toolbar_widget)
     {
+      int is_packed = x->handlebox_widget != 0;
       BLOCK_INPUT;
-      gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
-                            x->handlebox_widget);
+      /* We may have created the toolbar_widget in xg_create_tool_bar, but
+         not the x->handlebox_widget which is created in xg_pack_tool_bar.  */
+      if (is_packed)
+        gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
+                              x->handlebox_widget);
+      else
+        gtk_widget_destroy (x->toolbar_widget);
+
       x->toolbar_widget = 0;
       x->handlebox_widget = 0;
       FRAME_TOOLBAR_HEIGHT (f) = 0;