From 26c7cd4f22f82cceff147dbe9a47fdbb2ff06cb3 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 11 Jun 2020 18:33:44 +0200 Subject: Disconnect signal after extraction to avoid calling them on destroyed widgets. --- src/installationmanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/installationmanager.cpp') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index f57872fe..b1eaf1d3 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -163,7 +163,7 @@ bool InstallationManager::extractFiles(QString extractPath, QString title, bool installationProgress->cancel(); installationProgress->hide(); installationProgress->deleteLater(); - }); + }); installationProgress->setWindowFlags( installationProgress->windowFlags() & (~Qt::WindowContextHelpButtonHint)); if (!title.isEmpty()) { @@ -222,6 +222,11 @@ bool InstallationManager::extractFiles(QString extractPath, QString title, bool // Wait for future to complete: loop.exec(); + + // There might still be signal in the queue at this point but the progress dialog is + // going to be destroyed so we must disconnect the signals: + disconnect(this, &InstallationManager::progressUpdate, installationProgress, &QProgressDialog::setValue); + disconnect(this, &InstallationManager::progressFileChange, installationProgress, &QProgressDialog::setLabelText); future = futureWatcher.future(); } -- cgit v1.3.1