From: Kevin Ollivier Date: Mon, 9 Feb 2009 05:22:45 +0000 (+0000) Subject: Remove delegates before releasing the native object, so that we don't have delegate... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/42c2b729e84c7ff4ff82f679e2fbeca01d383f77?ds=sidebyside;hp=0600cf3ae91918b16ed54dbc4bbe7fc60a930166 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 --- diff --git a/src/osx/cocoa/menu.mm b/src/osx/cocoa/menu.mm index 3127597356..705fdc8947 100644 --- a/src/osx/cocoa/menu.mm +++ b/src/osx/cocoa/menu.mm @@ -186,6 +186,7 @@ protected : wxMenuCocoaImpl::~wxMenuCocoaImpl() { + [m_osxMenu setDelegate:nil]; [m_osxMenu release]; } diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index f442eef85a..ac233c8e19 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -227,6 +227,7 @@ wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl() wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl() { + [m_macWindow setDelegate:nil]; [m_macWindow release]; } diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 50ff8949a4..b93b614850 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -633,6 +633,7 @@ wxToolBar::~wxToolBar() if (m_macUsesNativeToolbar) MacInstallNativeToolbar( false ); + [(NSToolbar*)m_macToolbar setDelegate:nil]; [(NSToolbar*)m_macToolbar release]; m_macToolbar = NULL; }