diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2008-03-17 07:18:47 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2008-03-17 07:18:47 +0000 |
commit | 3760cd2bb5eb17f9f96047ada9c02e404ea90741 (patch) | |
tree | 27c0990b7ac0821d1447a2b5aece39093513fa35 /src/gtkutil.c | |
parent | 8c5fa515d49d07727b1cd28446c4a1178f9af43b (diff) | |
download | emacs-3760cd2bb5eb17f9f96047ada9c02e404ea90741.tar.gz |
(free_frame_tool_bar): Only call gtk_container_remove if
handlebox_widget is != 0.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 11 |
1 files changed, 9 insertions, 2 deletions
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; |