guarding against events sent to semi-destroyed instances, fixes #10418

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-01-30 08:01:41 +00:00
parent adf8a83f4f
commit 66ddd74d23

View File

@@ -343,6 +343,8 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
ControlPartCode previousControlPart = cEvent.GetParameter<ControlPartCode>(kEventParamControlPreviousPart , typeControlPartCode );
ControlPartCode currentControlPart = cEvent.GetParameter<ControlPartCode>(kEventParamControlCurrentPart , typeControlPartCode );
if ( currentControlPart == 0 )
{
if ( thisWindow->IsBeingDeleted() == false )
{
// kill focus
#if wxUSE_CARET
@@ -364,7 +366,10 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
inKillFocusEvent = false ;
}
}
}
else if ( previousControlPart == 0 )
{
if ( thisWindow->IsBeingDeleted() == false )
{
// set focus
// panel wants to track the window which was the last to have focus in it
@@ -382,6 +387,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
thisWindow->GetEventHandler()->ProcessEvent(event) ;
}
}
}
break;
case kEventControlSetFocusPart :
{