mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #846, core: shutdown when failure and assert for missing facade
This commit is contained in:
committed by
Mathew Sutcliffe
parent
235673123d
commit
ec3fc93a19
@@ -147,6 +147,8 @@ void CSwiftCore::initLogDisplay()
|
|||||||
void CSwiftCore::startCore(const QString &dBusAdress)
|
void CSwiftCore::startCore(const QString &dBusAdress)
|
||||||
{
|
{
|
||||||
if (dBusAdress.isEmpty()) { return; }
|
if (dBusAdress.isEmpty()) { return; }
|
||||||
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||||
|
Q_ASSERT_X(sGui->getCoreFacade(), Q_FUNC_INFO, "Missing facade");
|
||||||
|
|
||||||
ui->pb_StartCore->setEnabled(false);
|
ui->pb_StartCore->setEnabled(false);
|
||||||
ui->pb_StopCore->setEnabled(true);
|
ui->pb_StopCore->setEnabled(true);
|
||||||
@@ -163,7 +165,6 @@ void CSwiftCore::stopCore()
|
|||||||
ui->pb_StopCore->setEnabled(false);
|
ui->pb_StopCore->setEnabled(false);
|
||||||
ui->gb_DBusMode->setDisabled(false);
|
ui->gb_DBusMode->setDisabled(false);
|
||||||
sGui->processEventsToRefreshGui();
|
sGui->processEventsToRefreshGui();
|
||||||
|
|
||||||
sGui->exit();
|
sGui->exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ int main(int argc, char *argv[])
|
|||||||
Q_UNUSED(qa);
|
Q_UNUSED(qa);
|
||||||
BlackCore::CApplication a;
|
BlackCore::CApplication a;
|
||||||
a.addVatlibOptions();
|
a.addVatlibOptions();
|
||||||
a.start();
|
if (!a.start())
|
||||||
|
{
|
||||||
|
a.gracefulShutdown();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
return CBlackCoreTestMain::unitMain(argc, argv);
|
return CBlackCoreTestMain::unitMain(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user