mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Make sure contexts are "gracefulShutdown"
The shutdown was NOT called as it was canceled because of being in shutdown mode
This commit is contained in:
committed by
Mat Sutcliffe
parent
53bd5e6be7
commit
cb78453e7c
@@ -250,7 +250,7 @@ namespace BlackCore
|
||||
|
||||
bool CApplication::isShuttingDown() const
|
||||
{
|
||||
return m_shutdown;
|
||||
return m_shutdown || m_shutdownInProgress;
|
||||
}
|
||||
|
||||
bool CApplication::isIncognito() const
|
||||
@@ -1069,7 +1069,6 @@ namespace BlackCore
|
||||
|
||||
// mark as shutdown
|
||||
if (m_networkWatchDog) { m_networkWatchDog->gracefulShutdown(); }
|
||||
m_shutdown = true;
|
||||
|
||||
// save settings (but only when application was really alive)
|
||||
if (m_parsed && m_saveSettingsOnShutdown)
|
||||
@@ -1083,7 +1082,7 @@ namespace BlackCore
|
||||
// from here on we really rip apart the application object
|
||||
// and it should no longer be used
|
||||
|
||||
if (this->supportsContexts())
|
||||
if (this->supportsContexts(true))
|
||||
{
|
||||
CLogMessage(this).info(u"Graceful shutdown of CApplication, shutdown of contexts");
|
||||
|
||||
@@ -1117,8 +1116,12 @@ namespace BlackCore
|
||||
|
||||
// clean up all in "deferred delete state"
|
||||
qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete);
|
||||
sApp->processEventsFor(500);
|
||||
|
||||
// completed
|
||||
m_shutdown = true;
|
||||
sApp = nullptr;
|
||||
|
||||
disconnect(this);
|
||||
}
|
||||
|
||||
@@ -1548,9 +1551,9 @@ namespace BlackCore
|
||||
// Contexts
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
bool CApplication::supportsContexts() const
|
||||
bool CApplication::supportsContexts(bool ignoreShutdownTest) const
|
||||
{
|
||||
if (m_shutdown) { return false; }
|
||||
if (!ignoreShutdownTest && m_shutdown) { return false; }
|
||||
if (m_coreFacade.isNull()) { return false; }
|
||||
if (!m_coreFacade->getIContextApplication()) { return false; }
|
||||
return (!m_coreFacade->getIContextApplication()->isEmptyObject());
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace BlackCore
|
||||
//! Supports contexts
|
||||
//! \remark checks the real availability of the contexts, so it can happen that we want to use contexts, and they are not yet initialized (false here)
|
||||
//! \sa m_useContexts we use or we will use contexts
|
||||
bool supportsContexts() const;
|
||||
bool supportsContexts(bool ignoreShutdownTest = false) const;
|
||||
|
||||
//! The core facade config
|
||||
const CCoreFacadeConfig &getCoreFacadeConfig() const { return m_coreFacadeConfig; }
|
||||
|
||||
Reference in New Issue
Block a user