]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
don't use windows about to be destroyed as implicit dialog parent
[wxWidgets.git] / src / msw / toplevel.cpp
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(),