From c5a7d8631d682a8af65323776906c8a9fcc08b30 Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Sun, 5 Oct 2025 23:15:14 +0200 Subject: [PATCH 1/2] Fix the double deletion of Qml Engine --- app/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 43df2a9f6..30e7dcddf 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -573,9 +573,6 @@ int main( int argc, char *argv[] ) CoreUtils::log( QStringLiteral( "AppState" ), QStringLiteral( "Application has quit" ) ); } ); - // this fixes the error dump from C++ defined QML components, when quiting application - QObject::connect( &app, &QCoreApplication::aboutToQuit, &engine, &QQmlEngine::deleteLater ); - QObject::connect( &help, &InputHelp::submitReportSuccessful, &lambdaContext, [¬ificationModel]() { notificationModel.addSuccess( QObject::tr( "Report submitted. Please contact the support" ) ); @@ -869,6 +866,12 @@ int main( int argc, char *argv[] ) return EXIT_FAILURE; } + // this fixes the error dump from C++ defined QML components, when quiting application + QObject::connect(&app, &QCoreApplication::aboutToQuit, [&] { + object->deleteLater(); + engine.clearComponentCache(); + }); + #ifdef Q_OS_IOS QString logoUrl = "qrc:logo.png"; #else From b47af3f169db468400265fd81cad0267a154b203 Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Mon, 6 Oct 2025 15:39:41 +0200 Subject: [PATCH 2/2] Fix formatting & Clazy warning --- app/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 30e7dcddf..b01dcd4a7 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -867,10 +867,11 @@ int main( int argc, char *argv[] ) } // this fixes the error dump from C++ defined QML components, when quiting application - QObject::connect(&app, &QCoreApplication::aboutToQuit, [&] { - object->deleteLater(); - engine.clearComponentCache(); - }); + QObject::connect( &app, &QCoreApplication::aboutToQuit, object, [&] + { + object->deleteLater(); + engine.clearComponentCache(); + } ); #ifdef Q_OS_IOS QString logoUrl = "qrc:logo.png";