Ref T312, fixed thread safety of listeners start/stop/check

This commit is contained in:
Klaus Basan
2018-08-27 18:48:02 +02:00
parent 0b0a7783a0
commit 2c1055cc2e
3 changed files with 33 additions and 4 deletions

View File

@@ -443,10 +443,10 @@ namespace BlackSimPlugin
void CSimulatorEmulatedListener::startImpl()
{
if (this->isShuttingDown()) { return; }
const QPointer<CSimulatorEmulatedListener> guard(this);
const QPointer<CSimulatorEmulatedListener> myself(this);
QTimer::singleShot(2000, this, [ = ]
{
if (!guard) { return; }
if (!myself) { return; }
Q_ASSERT_X(this->getPluginInfo().isValid(), Q_FUNC_INFO, "Invalid plugin");
emit this->simulatorStarted(this->getPluginInfo());
});