Use proper method for deferred calls

This commit is contained in:
Chocobo1 2022-04-12 16:19:09 +08:00
parent a59a6ce8e4
commit 3f762a416d
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 9 additions and 6 deletions

View file

@ -47,6 +47,7 @@
#include <QByteArray>
#include <QDebug>
#include <QLibraryInfo>
#include <QMetaObject>
#include <QProcess>
#ifndef DISABLE_GUI
@ -770,7 +771,7 @@ void Application::shutdownCleanup(QSessionManager &manager)
// According to the qt docs we shouldn't call quit() inside a slot.
// aboutToQuit() is never emitted if the user hits "Cancel" in
// the above dialog.
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
QMetaObject::invokeMethod(qApp, &QCoreApplication::quit, Qt::QueuedConnection);
}
#endif