From d3b2a6dae889d1e96804cadbdced5881942e4c54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 17 Mar 2008 07:18:57 +0000 Subject: [PATCH] (free_frame_tool_bar): Only call gtk_container_remove if handlebox_widget is != 0. --- src/ChangeLog | 5 +++++ src/gtkutil.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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; -- 2.39.5