fix GetTLWParentIfNotBeingDeleted() to work correctly even if an intermediate non-TLW parent is being deleted, it should still return the TLW parent and not NULL in this case, otherwise we'd crash when a button child of a panel being deleted is current temporary default button [backport of r51570 from trunk]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -366,11 +366,12 @@ static wxTopLevelWindow *GetTLWParentIfNotBeingDeleted(wxWindow *win)
|
|||||||
{
|
{
|
||||||
for ( ; win; win = win->GetParent() )
|
for ( ; win; win = win->GetParent() )
|
||||||
{
|
{
|
||||||
if ( win->IsBeingDeleted() )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if ( win->IsTopLevel() )
|
if ( win->IsTopLevel() )
|
||||||
|
{
|
||||||
|
if ( win->IsBeingDeleted() )
|
||||||
|
return NULL;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxASSERT_MSG( win, _T("button without top level parent?") );
|
wxASSERT_MSG( win, _T("button without top level parent?") );
|
||||||
|
Reference in New Issue
Block a user