From: Jan Djärv Date: Mon, 17 Mar 2008 07:18:57 +0000 (+0000) Subject: (free_frame_tool_bar): Only call gtk_container_remove if X-Git-Tag: emacs-pretest-23.0.90~7077 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3b2a6dae889d1e96804cadbdced5881942e4c54;p=emacs.git (free_frame_tool_bar): Only call gtk_container_remove if handlebox_widget is != 0. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7bddd0a326f..42272453d81 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-03-17 Jan Dj$(Q)Z(Brv + + * gtkutil.c (free_frame_tool_bar): Only call gtk_container_remove if + handlebox_widget is != 0. + 2008-03-16 Juri Linkov * callint.c (Fcall_interactively): For interactive code letters diff --git a/src/gtkutil.c b/src/gtkutil.c index 03cc1c24b75..0881f5bdd5e 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -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;