From: Paul Cornett Date: Tue, 24 Jun 2008 06:48:02 +0000 (+0000) Subject: fix crash on exit, after hiding search tool then toggling tooltips X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dea482c985668168de4e9afeadc0cf04d6131bc5 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 --- 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);