From 326a37f1484ae04edd588728526876c4c784405c Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 14 Oct 2004 17:27:33 +0000 Subject: [PATCH] Fix to the crash in all MSW/OpenWatcom apps using toolbars. wxString() in A?B:C is not a good idea. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29845 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/tbarbase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 69f106b9ee..57daadc573 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -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 ); } -- 2.45.2