diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 6f94c924cc..85f121426b 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -409,7 +409,10 @@ void wxToolBarBase::UnToggleRadioGroup(wxToolBarToolBase *tool) void wxToolBarBase::ClearTools() { - WX_CLEAR_LIST(wxToolBarToolsList, m_tools); + while ( GetToolsCount() ) + { + DeleteToolByPos(0); + } } bool wxToolBarBase::Realize() diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 43a159862d..1dd377605c 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -455,6 +455,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) { nButtonsToDelete = ((wxToolBarTool *)tool)->GetSeparatorsCount(); width *= nButtonsToDelete; + tool->GetControl()->Destroy(); } // do delete all buttons