fixes crashes with embedded controls in toolbars after toolbar destruction, code was moved in r62988, but apparently Destroy doesn't have to be called, so do a last check, fixes #14258

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2012-05-05 05:32:19 +00:00
parent f8ab0cdb3e
commit 71940de693

View File

@ -932,6 +932,15 @@ wxToolBar::~wxToolBar()
if ( !m_macToolbar )
return;
// it might already have been uninstalled due to a previous call to Destroy, but in case
// wasn't, do so now, otherwise redraw events may occur for deleted objects
bool ownToolbarInstalled = false;
MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (ownToolbarInstalled)
{
MacUninstallNativeToolbar();
}
CFIndex count = CFGetRetainCount( m_macToolbar ) ;
// Leopard seems to have one refcount more, so we cannot check reliably at the moment
if ( UMAGetSystemVersion() < 0x1050 )