]> git.saurik.com Git - wxWidgets.git/commitdiff
don't use windows about to be destroyed as implicit dialog parent
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Oct 2001 00:10:51 +0000 (00:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Oct 2001 00:10:51 +0000 (00:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dialog.cpp
src/gtk1/dialog.cpp
src/msw/toplevel.cpp

index d1d13da9b38e604f0ec46147ac8ff66f683e4aae..e948cddd10abb7b784a68c8324a17df2264a2566 100644 (file)
@@ -198,7 +198,7 @@ int wxDialog::ShowModal()
     if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
     {
         wxWindow *parent = wxTheApp->GetTopWindow();
-        if ( parent && parent != this )
+        if ( parent && parent != this && parent->IsBeingDeleted() )
         {
             m_parent = parent;
             gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(parent->m_widget) );
index d1d13da9b38e604f0ec46147ac8ff66f683e4aae..e948cddd10abb7b784a68c8324a17df2264a2566 100644 (file)
@@ -198,7 +198,7 @@ int wxDialog::ShowModal()
     if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
     {
         wxWindow *parent = wxTheApp->GetTopWindow();
-        if ( parent && parent != this )
+        if ( parent && parent != this && parent->IsBeingDeleted() )
         {
             m_parent = parent;
             gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(parent->m_widget) );
index 0720766612eb0417614886e0784f9396c58661bf..8874a8d15634d733962f2ff6cd165d40cc518733 100644 (file)
@@ -192,6 +192,12 @@ bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate,
     if ( !parent && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
     {
         parent = wxTheApp->GetTopWindow();
+
+        // but don't use the window which is about to be destroyed as parent
+        if ( parent->IsBeingDeleted() )
+        {
+            parent = NULL;
+        }
     }
 
     m_hWnd = (WXHWND)::CreateDialog(wxGetInstance(),