[Client] Use QCoreApplication::exit() to leave on update

QCoreApplication::quit() only asks the application to quit and can be
interrupted if a top-level window refuses its close event. On the update path
the process must actually leave so its Qt DLLs are unlocked before the installer
starts replacing files - apply the exit(0) variant both on the accepted-close
path and the fallback where no MainWindow was ever closed.
This commit is contained in:
Lukas Brübach 2026-09-21 18:59:56 +02:00
parent 00dcc0d5c1
commit c3bc23a544

View file

@ -252,14 +252,14 @@ void DlgUpdate::downloadSuccessful(const QUrl &filepath)
// resolve the blocker, and tell them the installer is already waiting.
if (auto *window = qobject_cast<MainWindow *>(parent())) {
if (window->closeForUpdate()) {
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
QTimer::singleShot(0, qApp, [] { QCoreApplication::exit(0); });
} else {
QMessageBox::warning(this, tr("Update"),
tr("The update installer is already running and will finish the update once "
"Cockatrice closes. Cockatrice is still busy, so it stays open for now."));
}
} else {
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
QTimer::singleShot(0, qApp, [] { QCoreApplication::exit(0); });
}
close();
} else {