]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mainwin.cpp
kes Close bat console windows first to eliminate error message
[bacula/bacula] / bacula / src / qt-console / mainwin.cpp
index 92cc016051a4b85519d778d42d199a6372caa195..079c2a2f7a6baa6e401832048330013a74a7bdd9 100644 (file)
@@ -247,6 +247,16 @@ void MainWin::closeEvent(QCloseEvent *event)
 {
    m_isClosing = true;
    writeSettings();
+   /*
+    * Close the console pages before non-console pages so that
+    *  the notifier is turned off. Otherwise it prints an error when
+    *  the page it is using gets destroyed.
+    */
+   foreach(Console *console, m_consoleHash){
+      console->writeSettings();
+      console->terminate();
+      console->closeStackPage();
+   }
    /* close all non console pages, this will call settings in destructors */
    while (m_consoleHash.count() < m_pagehash.count()) {
       foreach(Pages *page, m_pagehash) {
@@ -259,12 +269,6 @@ void MainWin::closeEvent(QCloseEvent *event)
          }
       }
    }
-   /* close the console pages and terminate connection */
-   foreach(Console *console, m_consoleHash){
-      console->writeSettings();
-      console->terminate();
-      console->closeStackPage();
-   }
    event->accept();
 }