]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dialog.cpp
wxMimeTypesManagerImpl::GetFileTypeFromMimeType() implemented
[wxWidgets.git] / src / gtk1 / dialog.cpp
index f34fbdbf697568cbe0e26c2bf1842b9b6caf2104..f4a3d741444a46eca16280bd438c9ebcf4af9ac9 100644 (file)
@@ -14,6 +14,9 @@
 #include "wx/dialog.h"
 #include "wx/frame.h"
 #include "wx/app.h"
+
+#include "gdk/gdk.h"
+#include "gtk/gtk.h"
 #include "wx/gtk/win_gtk.h"
 
 //-----------------------------------------------------------------------------
@@ -131,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 )