mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Only check listener before starting
This commit is contained in:
@@ -470,7 +470,6 @@ namespace BlackCore
|
|||||||
|
|
||||||
ISimulatorListener *listener = m_plugins->createListener(simulatorInfo.getIdentifier());
|
ISimulatorListener *listener = m_plugins->createListener(simulatorInfo.getIdentifier());
|
||||||
if (!listener) { return false; }
|
if (!listener) { return false; }
|
||||||
if (listener->isRunning()) { return true; } // already running
|
|
||||||
|
|
||||||
if (listener->thread() != &m_listenersThread)
|
if (listener->thread() != &m_listenersThread)
|
||||||
{
|
{
|
||||||
@@ -486,10 +485,13 @@ namespace BlackCore
|
|||||||
listener->moveToThread(&m_listenersThread);
|
listener->moveToThread(&m_listenersThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool s = QMetaObject::invokeMethod(listener, "start", Qt::QueuedConnection);
|
// start if not already running
|
||||||
Q_ASSERT_X(s, Q_FUNC_INFO, "cannot invoke method");
|
if (!listener->isRunning())
|
||||||
Q_UNUSED(s);
|
{
|
||||||
|
const bool s = QMetaObject::invokeMethod(listener, "start", Qt::QueuedConnection);
|
||||||
|
Q_ASSERT_X(s, Q_FUNC_INFO, "cannot invoke method");
|
||||||
|
Q_UNUSED(s);
|
||||||
|
}
|
||||||
CLogMessage(this).info("Listening for simulator '%1'") << simulatorInfo.getIdentifier();
|
CLogMessage(this).info("Listening for simulator '%1'") << simulatorInfo.getIdentifier();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -512,7 +514,8 @@ namespace BlackCore
|
|||||||
if (!m_simulatorPlugin.first.isUnspecified())
|
if (!m_simulatorPlugin.first.isUnspecified())
|
||||||
{
|
{
|
||||||
ISimulator *simulator = m_simulatorPlugin.second;
|
ISimulator *simulator = m_simulatorPlugin.second;
|
||||||
if (simulator->isConnected()) {
|
if (simulator->isConnected())
|
||||||
|
{
|
||||||
// we are about to unload an connected simulator
|
// we are about to unload an connected simulator
|
||||||
this->updateMarkAllAsNotRendered(); // without plugin nothing can be rendered
|
this->updateMarkAllAsNotRendered(); // without plugin nothing can be rendered
|
||||||
emit this->simulatorStatusChanged(ISimulator::Disconnected);
|
emit this->simulatorStatusChanged(ISimulator::Disconnected);
|
||||||
|
|||||||
Reference in New Issue
Block a user