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