unset the dialog as top level window in Destroy(), not in dtor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -316,13 +316,6 @@ wxDialog::~wxDialog()
|
||||
{
|
||||
m_isBeingDeleted = TRUE;
|
||||
|
||||
wxTopLevelWindows.DeleteObject( this );
|
||||
|
||||
if (wxTheApp->GetTopWindow() == this)
|
||||
{
|
||||
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
||||
}
|
||||
|
||||
if ((wxTopLevelWindows.Number() == 0) &&
|
||||
(wxTheApp->GetExitOnFrameDelete()))
|
||||
{
|
||||
@@ -412,7 +405,20 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
|
||||
bool wxDialog::Destroy()
|
||||
{
|
||||
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
|
||||
// schedule the dialog for the deletion
|
||||
if ( !wxPendingDelete.Member(this) )
|
||||
{
|
||||
wxPendingDelete.Append(this);
|
||||
}
|
||||
|
||||
// don't leave a dangling pointer as the app top window, we can be deleted
|
||||
// any moment at all now!
|
||||
if ( wxTheApp->GetTopWindow() == this )
|
||||
{
|
||||
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
||||
}
|
||||
|
||||
wxTopLevelWindows.DeleteObject( this );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -316,13 +316,6 @@ wxDialog::~wxDialog()
|
||||
{
|
||||
m_isBeingDeleted = TRUE;
|
||||
|
||||
wxTopLevelWindows.DeleteObject( this );
|
||||
|
||||
if (wxTheApp->GetTopWindow() == this)
|
||||
{
|
||||
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
||||
}
|
||||
|
||||
if ((wxTopLevelWindows.Number() == 0) &&
|
||||
(wxTheApp->GetExitOnFrameDelete()))
|
||||
{
|
||||
@@ -412,7 +405,20 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
|
||||
bool wxDialog::Destroy()
|
||||
{
|
||||
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
|
||||
// schedule the dialog for the deletion
|
||||
if ( !wxPendingDelete.Member(this) )
|
||||
{
|
||||
wxPendingDelete.Append(this);
|
||||
}
|
||||
|
||||
// don't leave a dangling pointer as the app top window, we can be deleted
|
||||
// any moment at all now!
|
||||
if ( wxTheApp->GetTopWindow() == this )
|
||||
{
|
||||
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
||||
}
|
||||
|
||||
wxTopLevelWindows.DeleteObject( this );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user