]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dialog.cpp
wxMimeTypesManagerImpl::GetFileTypeFromMimeType() implemented
[wxWidgets.git] / src / gtk1 / dialog.cpp
index ceba49654877a4814af74b2168762bd3f214ceee..f4a3d741444a46eca16280bd438c9ebcf4af9ac9 100644 (file)
@@ -134,7 +134,16 @@ bool wxDialog::Create( wxWindow *parent,
 wxDialog::~wxDialog()
 {
     wxTopLevelWindows.DeleteObject( this );
-    if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
+    
+    if (wxTheApp->GetTopWindow() == this)
+    {
+        wxTheApp->SetTopWindow( (wxWindow*) NULL );
+    }
+    
+    if (wxTopLevelWindows.Number() == 0)
+    {  
+        wxTheApp->ExitMainLoop();
+    }
 }
 
 void wxDialog::SetTitle( const wxString& title )