From 3fdfbc9ca1be0953cede4a2a9389e0c853a71b48 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 24 Jan 2011 16:45:25 +0000 Subject: [PATCH] guarding code in case of delayed controller release git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/iphone/nonownedwnd.mm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/osx/iphone/nonownedwnd.mm b/src/osx/iphone/nonownedwnd.mm index 9c14e09ac3..2eed113035 100644 --- a/src/osx/iphone/nonownedwnd.mm +++ b/src/osx/iphone/nonownedwnd.mm @@ -407,15 +407,18 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) -(void) viewWillDisappear:(BOOL)animated { wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] ); - wxNonOwnedWindow* now = dynamic_cast (impl->GetWXPeer()); - wxNonOwnedWindowIPhoneImpl* nowimpl = dynamic_cast (now->GetNonOwnedPeer()); - - if ( nowimpl->InitialShowEventSent() ) + if( impl ) { - wxShowEvent eventShow(now->GetId(), false); - eventShow.SetEventObject(now); - - now->HandleWindowEvent(eventShow); + wxNonOwnedWindow* now = dynamic_cast (impl->GetWXPeer()); + wxNonOwnedWindowIPhoneImpl* nowimpl = dynamic_cast (now->GetNonOwnedPeer()); + + if ( nowimpl->InitialShowEventSent() ) + { + wxShowEvent eventShow(now->GetId(), false); + eventShow.SetEventObject(now); + + now->HandleWindowEvent(eventShow); + } } } -- 2.45.2