Fix to the crash in all MSW/OpenWatcom apps using toolbars. wxString() in A?B:C is...
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 14 Oct 2004 17:27:33 +0000 (17:27 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 14 Oct 2004 17:27:33 +0000 (17:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29845 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/tbarbase.cpp

index 69f106b9ee85172b1b780cd3d94e2efd34316caf..57daadc5735e0643eb10b758c4988d4f27c0ed75 100644 (file)
@@ -611,8 +611,10 @@ void wxToolBarBase::OnMouseEnter(int id)
     wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
     if( frame )
     {
-        wxToolBarToolBase* tool = id == wxID_ANY ? (wxToolBarToolBase*)0 : FindById(id);
-        wxString help = tool ? tool->GetLongHelp() : wxString();
+        wxString help;
+        wxToolBarToolBase* tool = id == wxID_ANY ? (wxToolBarToolBase*)NULL : FindById(id);
+        if(tool)
+            help = tool->GetLongHelp();
         frame->DoGiveHelp( help, id != wxID_ANY );
     }