From f9f233cf9c8a98b4579a17557511cc04c2b547fd Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Fri, 17 Nov 2023 18:47:26 +1100 Subject: [PATCH] Delete command before app destruction (QTBUG-119063) --- src/cli/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cli/main.cpp b/src/cli/main.cpp index df85f0f7b..2d2eeef59 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -336,8 +336,7 @@ int main(int argc, char *argv[]) for (const QString &error: cliErrors) { showCliError(error); } - if (!cliErrors.isEmpty()) { - return EXIT_FAILURE; - } - return (command->start()) ? QCoreApplication::exec() : EXIT_FAILURE; + const int result = ((cliErrors.isEmpty()) && (command->start())) ? QCoreApplication::exec() : EXIT_FAILURE; + delete command; + return result; }