return true;
}
-wxToolBarToolBase::~wxToolBarToolBase()
-{
-}
-
// ----------------------------------------------------------------------------
// wxToolBarBase adding/deleting items
// ----------------------------------------------------------------------------
wxToolBarBase::~wxToolBarBase()
{
WX_CLEAR_LIST(wxToolBarToolsList, m_tools);
+
+ // notify the frame that it doesn't have a tool bar any longer to avoid
+ // dangling pointers
+ wxFrameBase *frame = wxDynamicCast(GetParent(), wxFrameBase);
+ if ( frame && frame->GetToolBar() == this )
+ {
+ frame->SetToolBar(NULL);
+ }
}
// ----------------------------------------------------------------------------
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 );
}