History

Fixed blocking call

Karol Suprynowicz committed 1 year ago

Commit d9c58211 parent 9e261461 file · +3 −4Browse files

Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+3−4
@@ -2498,11 +2498,10 @@ void ScriptManager::unloadAllEntityScripts(bool blockingCall) { · 2497 unmodified lines
2498#ifdef THREAD_DEBUGGING2498#ifdef THREAD_DEBUGGING
2499 qCDebug(scriptengine) << "*** WARNING *** ScriptManager::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";2499 qCDebug(scriptengine) << "*** WARNING *** ScriptManager::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
2500#endif2500#endif
2501
2502 // Lambda is necessary there to keep shared_ptr counter above zero2501 // Lambda is necessary there to keep shared_ptr counter above zero
2503 QMetaObject::invokeMethod(this, [=, manager = shared_from_this()]{2502 QMetaObject::invokeMethod(this, [=, manager = shared_from_this()] {
2504 manager->unloadAllEntityScripts(blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection);2503 manager->unloadAllEntityScripts(blockingCall);
2505 });2504 }, blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection);
2506 return;2505 return;
2507 }2506 }
2508#ifdef THREAD_DEBUGGING2507#ifdef THREAD_DEBUGGING