mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Merge pull request #4937 from Chocobo1/option_crash
Fix crash when qbt exits with options dialog opened
This commit is contained in:
commit
8e64ffba01
@ -33,6 +33,7 @@
|
|||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QAtomicInt>
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
#include "gui/guiiconprovider.h"
|
#include "gui/guiiconprovider.h"
|
||||||
@ -547,11 +548,9 @@ void Application::cleanup()
|
|||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// cleanup() can be called multiple times during shutdown. We only need it once.
|
// cleanup() can be called multiple times during shutdown. We only need it once.
|
||||||
static bool alreadyDone = false;
|
static QAtomicInt alreadyDone;
|
||||||
|
if (!alreadyDone.testAndSetAcquire(0, 1))
|
||||||
if (alreadyDone)
|
|
||||||
return;
|
return;
|
||||||
alreadyDone = true;
|
|
||||||
#endif // Q_OS_WIN
|
#endif // Q_OS_WIN
|
||||||
|
|
||||||
// Hide the window and not leave it on screen as
|
// Hide the window and not leave it on screen as
|
||||||
|
@ -678,12 +678,12 @@ void MainWindow::cleanup()
|
|||||||
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC))
|
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC))
|
||||||
m_programUpdateTimer->stop();
|
m_programUpdateTimer->stop();
|
||||||
#endif
|
#endif
|
||||||
delete m_searchFilter;
|
|
||||||
delete m_searchFilterAction;
|
delete m_searchFilterAction;
|
||||||
delete m_tabs; // this seems enough to also delete all contained widgets
|
|
||||||
delete m_statusBar;
|
// remove all child widgets
|
||||||
delete m_pwr;
|
while (QWidget *w = findChild<QWidget *>())
|
||||||
delete m_toolbarMenu;
|
delete w;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::readSettings()
|
void MainWindow::readSettings()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user