From 1b420e0e7cb7501f3d2c1987c9b9b1b37307c78a Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 18 Nov 2002 22:39:58 +0000 Subject: [PATCH] Check whether m_toolCapture is NULL before using it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/toolbar.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index 1d68c60857..1745a900fd 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -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;