]> git.saurik.com Git - wxWidgets.git/commitdiff
fix crash on exit, after hiding search tool then toggling tooltips
authorPaul Cornett <paulcor@bullseye.com>
Tue, 24 Jun 2008 06:48:02 +0000 (06:48 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 24 Jun 2008 06:48:02 +0000 (06:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/toolbar/toolbar.cpp

index 181d7188f152d4937d376fda97d428dbee8322c0..c1c95e469b6283c13370cc22bf83eaf05aeb2380 100644 (file)
@@ -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);