Prevent tray menu from being accessed after destruction

PR #17400.
This commit is contained in:
Vladimir Golovnev
2022-07-21 09:30:05 +03:00
committed by GitHub
parent 71e53a4628
commit 5b269a782a
2 changed files with 10 additions and 5 deletions

View File

@@ -481,6 +481,7 @@ MainWindow::MainWindow(IGUIApplication *app, QWidget *parent)
MainWindow::~MainWindow()
{
app()->desktopIntegration()->setMenu(nullptr);
delete m_ui;
}
@@ -1171,11 +1172,6 @@ void MainWindow::closeEvent(QCloseEvent *e)
}
}
// Disable some UI to prevent user interactions
app()->desktopIntegration()->disconnect();
app()->desktopIntegration()->setToolTip(tr("qBittorrent is shutting down..."));
app()->desktopIntegration()->menu()->setEnabled(false);
// Accept exit
e->accept();
qApp->exit();