mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
[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:
parent
00dcc0d5c1
commit
c3bc23a544
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue