]> git.sesse.net Git - nageru/commitdiff
Fix a cleanup issue.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 6 Dec 2018 17:39:02 +0000 (18:39 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 6 Dec 2018 17:39:02 +0000 (18:39 +0100)
In newer Qt, evidently when using the close button on the window
(not when calling close() as a result of a menu item!), the GLWidgets'
contexts will be gone by the time app.exec() returns, preventing us
from doing proper cleanup. Do the mixer cleanup in closeEvent() instead,
fixing the issue.

nageru/main.cpp
nageru/mainwindow.cpp

index d5654a5a07c4ef26bb8924b7fa8cd7f1362cc827..410a6c42d7fcaa7e78b3b31d58b98b0c935d4beb 100644 (file)
@@ -119,8 +119,6 @@ int main(int argc, char *argv[])
        }
 
        int rc = app.exec();
-       global_mixer->quit();
-       mainWindow.mixer_shutting_down();
        delete global_mixer;
        ImageInput::shutdown_updaters();
        return rc;
index 11e63913ea59734e9831ef5e625be3154020f704..d0d9b6c49e89ecbd3073d5fbaf41c1e0300e1b5c 100644 (file)
@@ -1548,6 +1548,8 @@ void MainWindow::closeEvent(QCloseEvent *event)
        }
 
        analyzer->hide();
+       global_mixer->quit();
+       mixer_shutting_down();
        event->accept();
 }