Browse Source

Crash fix: don't call exitLoop while in a modal dialog.

git-svn-id: file:///var/svn/tigccpp/trunk@678 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 years ago
parent
commit
4e4cc6d5fa
1 changed files with 7 additions and 0 deletions
  1. 7 0
      ktigcc/mainform.ui.h

+ 7 - 0
ktigcc/mainform.ui.h

@@ -46,6 +46,7 @@
 #include <qdatetime.h>
 #include <qtextcodec.h>
 #include <qstylesheet.h>
+#include <qtimer.h>
 #include <kparts/factory.h>
 #include <klibloader.h>
 #include <kate/document.h>
@@ -3295,6 +3296,12 @@ static unsigned ldTigccStatPhase=0;
 
 void MainForm::procio_processExited()
 {
+  // If we're in a modal dialog, let it complete or exiting the event loop will
+  // crash.
+  if (QApplication::eventLoop()->loopLevel()>2) {
+    QTimer::singleShot(100,this,SLOT(procio_processExited()));
+    return;
+  }
   errorFunction=QString::null;
   ldTigccStatPhase=0;
   QApplication::eventLoop()->exitLoop();