mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Use thread instance comparison to check whether the listener is set up
or not
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3d81199d79
commit
2a3dc05fb0
@@ -409,7 +409,7 @@ namespace BlackCore
|
||||
ISimulatorListener *listener = m_plugins->getListener(simulatorInfo.getIdentifier());
|
||||
Q_ASSERT_X(listener, Q_FUNC_INFO, "No listener");
|
||||
|
||||
if (!listener->property("isInitialized").isValid() || listener->property("isInitialized").toBool() == false)
|
||||
if (listener->thread() != &m_listenersThread)
|
||||
{
|
||||
bool c = connect(listener, &ISimulatorListener::simulatorStarted, this, &CContextSimulator::ps_simulatorStarted);
|
||||
if (!c)
|
||||
@@ -417,10 +417,9 @@ namespace BlackCore
|
||||
CLogMessage(this).error("Unable to use '%1'") << simulatorInfo.toQString();
|
||||
return;
|
||||
}
|
||||
|
||||
Q_ASSERT_X(!listener->parent(), Q_FUNC_INFO, "Objects with parent cannot be moved to thread");
|
||||
listener->moveToThread(&m_listenersThread);
|
||||
|
||||
listener->setProperty("isInitialized", true);
|
||||
}
|
||||
|
||||
bool s = QMetaObject::invokeMethod(listener, "start", Qt::QueuedConnection);
|
||||
|
||||
Reference in New Issue
Block a user