X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7af79c94e6d64716bf120fcdf1e1dc9d78932686..fa2f5d3bc9563c2b88282d5487758572d8baffb3:/src/mac/carbon/toolbar.cpp diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 6bd7d0b114..c1d36f4122 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -159,6 +159,13 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons wxToolBar::~wxToolBar() { + size_t index = 0 ; + for ( index = 0 ; index < m_macToolHandles.Count() ; ++index ) + { + // Delete the control as we get ghosts otherwise + ::DisposeControl( (ControlHandle) m_macToolHandles[index] ); + } + // we must refresh the frame size when the toolbar is deleted but the frame // is not - otherwise toolbar leaves a hole in the place it used to occupy } @@ -202,7 +209,6 @@ bool wxToolBar::Realize() while (node) { wxToolBarTool *tool = (wxToolBarTool *)node->Data(); -// wxBitmapRefData * bmap = (wxBitmapRefData*) ( tool->GetNormalBitmap().GetRefData()) ; if( !tool->IsSeparator() ) { @@ -394,7 +400,6 @@ void wxToolBar::MacSuperChangedPosition() while (node) { wxToolBarTool *tool = (wxToolBarTool *)node->Data(); - // wxBitmapRefData * bmap = (wxBitmapRefData*) ( tool->GetNormalBitmap().GetRefData()) ; if( !tool->IsSeparator() ) {