]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/toolbar.cpp
Applied some of patch [ 650957 ] wxWinCE diff-0.0.4
[wxWidgets.git] / src / univ / toolbar.cpp
index 1d68c60857559db89ab5508955e6460aea75063a..1745a900fd93144c277f0a39396cf38a967a9a0c 100644 (file)
@@ -663,10 +663,13 @@ bool wxStdToolbarInputHandler::HandleMouse(wxInputConsumer *consumer,
                 m_winCapture = NULL;
             }
 
-            if ( tool == m_toolCapture )
-                consumer->PerformAction( wxACTION_BUTTON_TOGGLE, m_toolCapture->GetId() );
-            else
-                consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
+            if (m_toolCapture)
+            {
+                if ( tool == m_toolCapture )
+                    consumer->PerformAction( wxACTION_BUTTON_TOGGLE, m_toolCapture->GetId() );
+                else
+                    consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
+            }
             
             m_toolCapture = NULL;