# HG changeset patch # User Chris Cannam # Date 1326987419 0 # Node ID bc04d651f8a4e1127390495f9b08471b9f8bd702 # Parent 073733da4b6c5ed41a551840626d442dac160c33 Ensure all windows are closed when the main one is (thus exiting the application even if some other windows were still open) diff -r 073733da4b6c -r bc04d651f8a4 main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Jan 19 14:44:35 2012 +0000 +++ b/main/MainWindow.cpp Thu Jan 19 15:36:59 2012 +0000 @@ -149,6 +149,7 @@ m_soloAction(0), m_soloModified(false), m_prevSolo(false), + m_exiting(false), m_rwdStartAction(0), m_rwdSimilarAction(0), m_rwdAction(0), @@ -2989,6 +2990,11 @@ void MainWindow::closeEvent(QCloseEvent *e) { + if (m_exiting) { + e->accept(); + return; + } + // SVDEBUG << "MainWindow::closeEvent" << endl; if (m_openingAudioFile) { @@ -3021,6 +3027,10 @@ closeSession(); e->accept(); + + m_exiting = true; + qApp->closeAllWindows(); + return; } diff -r 073733da4b6c -r bc04d651f8a4 main/MainWindow.h --- a/main/MainWindow.h Thu Jan 19 14:44:35 2012 +0000 +++ b/main/MainWindow.h Thu Jan 19 15:36:59 2012 +0000 @@ -218,6 +218,8 @@ bool m_soloModified; bool m_prevSolo; + bool m_exiting; + QFrame *m_playControlsSpacer; int m_playControlsWidth;