diff --git a/app/main.cpp b/app/main.cpp index 43df2a9f6..b01dcd4a7 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,13 @@ 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, [&] + { + object->deleteLater(); + engine.clearComponentCache(); + } ); + #ifdef Q_OS_IOS QString logoUrl = "qrc:logo.png"; #else