From dea482c985668168de4e9afeadc0cf04d6131bc5 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 24 Jun 2008 06:48:02 +0000 Subject: [PATCH] fix crash on exit, after hiding search tool then toggling tooltips git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/toolbar/toolbar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 181d7188f1..c1c95e469b 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -332,6 +332,13 @@ void MyFrame::RecreateToolbar() wxToolBarBase *toolBar = GetToolBar(); long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE; + if (toolBar && m_searchTool && m_searchTool->GetToolBar() == NULL) + { + // see ~MyFrame() + toolBar->AddTool(m_searchTool); + } + m_searchTool = NULL; + delete toolBar; SetToolBar(NULL); -- 2.50.0