Remove delegates before releasing the native object, so that we don't have delegate methods getting called during destruction.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2009-02-09 05:22:45 +00:00
parent 0600cf3ae9
commit 42c2b729e8
3 changed files with 3 additions and 0 deletions

View File

@@ -186,6 +186,7 @@ protected :
wxMenuCocoaImpl::~wxMenuCocoaImpl()
{
[m_osxMenu setDelegate:nil];
[m_osxMenu release];
}

View File

@@ -227,6 +227,7 @@ wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl()
wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl()
{
[m_macWindow setDelegate:nil];
[m_macWindow release];
}

View File

@@ -633,6 +633,7 @@ wxToolBar::~wxToolBar()
if (m_macUsesNativeToolbar)
MacInstallNativeToolbar( false );
[(NSToolbar*)m_macToolbar setDelegate:nil];
[(NSToolbar*)m_macToolbar release];
m_macToolbar = NULL;
}