Tell Windows to wait during shutdown by creating a ShutdownBlockReason.

Huge thanks to paolo-sz for bringing this to my attention, for the various patches he tried to submit and for testing.
See issue #1984 for complete history.
Closes #1535.
This commit is contained in:
sledgehammer999 2015-04-16 00:47:59 +03:00
parent 6c1740f78f
commit 6644fe0714
4 changed files with 106 additions and 5 deletions

View file

@ -369,8 +369,6 @@ MainWindow::MainWindow(QWidget *parent)
MainWindow::~MainWindow()
{
// Save window size, columns size
writeSettings();
#ifdef Q_OS_MAC
// Workaround to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-7305
setUnifiedTitleAndToolBarOnMac(false);
@ -592,6 +590,25 @@ void MainWindow::writeSettings()
properties->saveSettings();
}
void MainWindow::cleanup()
{
writeSettings();
delete executable_watcher;
guiUpdater->stop();
if (systrayCreator)
systrayCreator->stop();
if (preventTimer)
preventTimer->stop();
programUpdateTimer.stop();
delete search_filter;
delete searchFilterAct;
delete tabs; // this seems enough to also delete all contained widgets
delete status_bar;
delete m_pwr;
delete toolbarMenu;
}
void MainWindow::readSettings()
{
const Preferences* const pref = Preferences::instance();