fixed a bug preventing quasel from crashing on exit
[quassel.git] / src / common / main_mono.cpp
index a7565c5..84e6fae 100644 (file)
@@ -57,9 +57,13 @@ int main(int argc, char **argv) {
   mainWin->init();
   int exitCode = app.exec();
   //delete core;
   mainWin->init();
   int exitCode = app.exec();
   //delete core;
+  
+  // the mainWin has to be deleted before the Core
+  // if not Quassel will crash on exit under certain conditions since the gui
+  // still wants to access clientdata
+  delete mainWin;
   Client::destroy();
   Core::destroy();
   Client::destroy();
   Core::destroy();
-  delete mainWin;
   //delete guiProxy;
   //delete coreProxy;
   //delete global;
   //delete guiProxy;
   //delete coreProxy;
   //delete global;