From 90652d355529ee65cd9475583ea12d164b8d1883 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 15 Sep 2022 11:56:00 +0800 Subject: [PATCH] WebAPI: fix wrong behavior for shutdown action Qt6 has changed implementation for `QCoreApplication::quit` and therefore it is not suitable anymore. Closes #17709. PR #17720. --- src/webui/api/appcontroller.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index a535c964b..410499ec9 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -91,12 +91,13 @@ void AppController::buildInfoAction() void AppController::shutdownAction() { - qDebug() << "Shutdown request from Web UI"; - - // Special case handling for shutdown, we + // Special handling for shutdown, we // need to reply to the Web UI before // actually shutting down. - QTimer::singleShot(100ms, qApp, &QCoreApplication::quit); + QTimer::singleShot(100ms, qApp, []() + { + QCoreApplication::exit(); + }); } void AppController::preferencesAction()