]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toolbar.cpp
use (new) safer GetTraitsIfExists() in wxMutexGuiEnter/Leave() to avoid crashing...
[wxWidgets.git] / src / msw / toolbar.cpp
index 16bd76be16725f674805b32abca48fe80dab53b6..e8c47e5ed3e09a7ec923a530ca2bcf1e785f5a94 100644 (file)
@@ -581,13 +581,15 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
         wxToolBarTool *tool2 = (wxToolBarTool*)node->GetData();
         if ( tool2->IsControl() )
         {
+            wxControl * const control = tool2->GetControl();
+
             int x;
-            wxControl *control = tool2->GetControl();
             control->GetPosition(&x, NULL);
             control->Move(x - width, wxDefaultCoord);
 
-            wxStaticText* staticText = tool2->GetStaticText();
-            staticText->Move(x - width, wxDefaultCoord);
+            wxStaticText * const staticText = tool2->GetStaticText();
+            if ( staticText )
+                staticText->Move(x - width, wxDefaultCoord);
         }
     }