mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 11:25:33 +08:00
Create "shutdown" message to find how far we get if swift hangs during shutdown
This commit is contained in:
committed by
Mat Sutcliffe
parent
6eb767f938
commit
0ee522426a
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <QApplication>
|
||||
#include <QTextStream>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user