From ec3fc93a19e4f3473fe6f4693bc8e9a7751473ff Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 29 Dec 2016 01:34:22 +0100 Subject: [PATCH] refs #846, core: shutdown when failure and assert for missing facade --- src/swiftcore/swiftcore.cpp | 3 ++- tests/blackcore/main.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index af95c6a4b..273a7c914 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -147,6 +147,8 @@ void CSwiftCore::initLogDisplay() void CSwiftCore::startCore(const QString &dBusAdress) { 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_StopCore->setEnabled(true); @@ -163,7 +165,6 @@ void CSwiftCore::stopCore() ui->pb_StopCore->setEnabled(false); ui->gb_DBusMode->setDisabled(false); sGui->processEventsToRefreshGui(); - sGui->exit(); } diff --git a/tests/blackcore/main.cpp b/tests/blackcore/main.cpp index 56e4b24bf..1248ff261 100644 --- a/tests/blackcore/main.cpp +++ b/tests/blackcore/main.cpp @@ -29,7 +29,11 @@ int main(int argc, char *argv[]) Q_UNUSED(qa); BlackCore::CApplication a; a.addVatlibOptions(); - a.start(); + if (!a.start()) + { + a.gracefulShutdown(); + return EXIT_FAILURE; + } return CBlackCoreTestMain::unitMain(argc, argv); }