# HG changeset patch # User Chris Cannam # Date 1327942599 0 # Node ID 032deed8b35b2feb66d5ab6fdc36e24f754086e3 # Parent d2a58dfc3ae5a6af4dd98ca09c209a80e8fe9c46 Connect quit function directly to closeAllWindows rather than try to closeAllWindows from close() (which strangely hangs on Windows) diff -r d2a58dfc3ae5 -r 032deed8b35b main/MainWindow.cpp --- a/main/MainWindow.cpp Mon Jan 30 16:06:47 2012 +0000 +++ b/main/MainWindow.cpp Mon Jan 30 16:56:39 2012 +0000 @@ -149,7 +149,6 @@ m_soloAction(0), m_soloModified(false), m_prevSolo(false), - m_exiting(false), m_rwdStartAction(0), m_rwdSimilarAction(0), m_rwdAction(0), @@ -576,7 +575,7 @@ tr("&Quit"), this); action->setShortcut(tr("Ctrl+Q")); action->setStatusTip(tr("Exit Sonic Visualiser")); - connect(action, SIGNAL(triggered()), this, SLOT(close())); + connect(action, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); m_keyReference->registerShortcut(action); menu->addAction(action); } @@ -3038,12 +3037,7 @@ void MainWindow::closeEvent(QCloseEvent *e) { - if (m_exiting) { - e->accept(); - return; - } - -// SVDEBUG << "MainWindow::closeEvent" << endl; +// std::cerr << "MainWindow::closeEvent" << std::endl; if (m_openingAudioFile) { // std::cerr << "Busy - ignoring close event" << std::endl; @@ -3052,7 +3046,7 @@ } if (!m_abandoning && !checkSaveModified()) { -// SVDEBUG << "Ignoring close event" << endl; +// std::cerr << "Close refused by user - ignoring close event" << endl; e->ignore(); return; } @@ -3076,9 +3070,6 @@ e->accept(); - m_exiting = true; - qApp->closeAllWindows(); - return; } @@ -3437,7 +3428,7 @@ LayerFactory::LayerTypeSet emptyTypes = LayerFactory::getInstance()->getValidEmptyLayerTypes(); - Layer *newLayer; + Layer *newLayer = 0; if (emptyTypes.find(type) != emptyTypes.end()) { diff -r d2a58dfc3ae5 -r 032deed8b35b main/MainWindow.h --- a/main/MainWindow.h Mon Jan 30 16:06:47 2012 +0000 +++ b/main/MainWindow.h Mon Jan 30 16:56:39 2012 +0000 @@ -230,8 +230,6 @@ bool m_soloModified; bool m_prevSolo; - bool m_exiting; - QFrame *m_playControlsSpacer; int m_playControlsWidth;