]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/toolbar/toolbar.cpp
fixing infinite recursion for rotated text, introduced in cleanup r57915
[wxWidgets.git] / 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);