Fix assert in DBus if dbus_server_listen returned NULL

ref T589
This commit is contained in:
Roland Rossgotterer
2019-04-03 08:59:54 +02:00
committed by Mat Sutcliffe
parent 77acffb73e
commit 821e0b10b6
5 changed files with 20 additions and 7 deletions

View File

@@ -103,7 +103,11 @@ namespace XSwiftBus
// FIXME: make listen address configurable
std::string listenAddress = "tcp:host=" + m_pluginConfig.getDBusAddress() + ",port=" + std::to_string(m_pluginConfig.getDBusPort());
m_dbusP2PServer->listen(listenAddress);
if (! m_dbusP2PServer->listen(listenAddress))
{
m_service->addTextMessage("XSwiftBus startup failed!", 255, 0, 0);
return;
}
m_dbusP2PServer->setDispatcher(&m_dbusDispatcher);
m_dbusP2PServer->setNewConnectionFunc([this](const std::shared_ptr<CDBusConnection> &conn)
@@ -140,7 +144,9 @@ namespace XSwiftBus
m_weather->registerDBusObjectPath(m_weather->InterfaceName(), m_weather->ObjectPath());
}
//! todo RR: Send all logs to the the message window.
INFO_LOG("XSwiftBus started.");
m_service->addTextMessage("XSwiftBus started.", 0, 255, 255);
}
void CPlugin::onAircraftModelChanged()