diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 6a22d7be1..20b153cd0 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -1046,12 +1046,18 @@ namespace BlackCore if (m_shutdownInProgress) { return; } m_shutdownInProgress = true; + CLogMessage(this).info(u"Graceful shutdown of CApplication started"); + // info that we will shutdown emit this->aboutToShutdown(); // Release all input devices to not cause any accidental hotkey triggers anymore. // This is also necessary to properly free platform specific instances at a defined point in time. - if (m_inputManager) { m_inputManager->releaseDevices(); } + if (m_inputManager) + { + CLogMessage(this).info(u"Graceful shutdown of CApplication, released devices"); + m_inputManager->releaseDevices(); + } // mark as shutdown if (m_networkWatchDog) { m_networkWatchDog->gracefulShutdown(); } @@ -1071,6 +1077,8 @@ namespace BlackCore if (this->supportsContexts()) { + CLogMessage(this).info(u"Graceful shutdown of CApplication, shutdown of contexts"); + // clean up facade m_coreFacade->gracefulShutdown(); m_coreFacade.reset(); @@ -1078,6 +1086,8 @@ namespace BlackCore if (m_webDataServices) { + CLogMessage(this).info(u"Graceful shutdown of CApplication, shutdown of web services"); + m_webDataServices->gracefulShutdown(); m_webDataServices.reset(); } @@ -1094,8 +1104,10 @@ namespace BlackCore m_networkWatchDog = nullptr; } + CLogMessage(this).info(u"Graceful shutdown of CApplication, shutdown of logger"); m_fileLogger->close(); + // clean up all in "deferred delete state" qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete); sApp = nullptr; diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index dae3b97f8..0fe93f5b9 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -1325,8 +1325,10 @@ namespace BlackGui { if (m_shutdownInProgress) { return; } CApplication::gracefulShutdown(); + CLogMessage(this).info(u"Graceful shutdown of GUI application started"); if (m_saveMainWidgetState) { + CLogMessage(this).info(u"Graceful shutdown, saving geometry"); this->saveWindowGeometryAndState(); } } diff --git a/src/swiftguistandard/main.cpp b/src/swiftguistandard/main.cpp index c8969af3f..4e2dfa713 100644 --- a/src/swiftguistandard/main.cpp +++ b/src/swiftguistandard/main.cpp @@ -17,6 +17,7 @@ #include #include +#include using namespace BlackGui; using namespace BlackMisc; @@ -49,6 +50,13 @@ int main(int argc, char *argv[]) SwiftGuiStd w(windowMode); w.show(); - int r = a.exec(); + const int r = a.exec(); + + // log we are really closing + QTextStream ts(stdout); + ts << "swift is closing now ......\n"; + ts.flush(); + + // bye return r; }