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
This commit is contained in:
Stefan Csomor
2011-01-24 16:45:25 +00:00
parent 1acf670a9d
commit 3fdfbc9ca1

View File

@@ -407,15 +407,18 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
-(void) viewWillDisappear:(BOOL)animated
{
wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] );
wxNonOwnedWindow* now = dynamic_cast<wxNonOwnedWindow*> (impl->GetWXPeer());
wxNonOwnedWindowIPhoneImpl* nowimpl = dynamic_cast<wxNonOwnedWindowIPhoneImpl*> (now->GetNonOwnedPeer());
if ( nowimpl->InitialShowEventSent() )
if( impl )
{
wxShowEvent eventShow(now->GetId(), false);
eventShow.SetEventObject(now);
now->HandleWindowEvent(eventShow);
wxNonOwnedWindow* now = dynamic_cast<wxNonOwnedWindow*> (impl->GetWXPeer());
wxNonOwnedWindowIPhoneImpl* nowimpl = dynamic_cast<wxNonOwnedWindowIPhoneImpl*> (now->GetNonOwnedPeer());
if ( nowimpl->InitialShowEventSent() )
{
wxShowEvent eventShow(now->GetId(), false);
eventShow.SetEventObject(now);
now->HandleWindowEvent(eventShow);
}
}
}