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
24982498 #ifdef THREAD_DEBUGGING
24992499 qCDebug(scriptengine) << "*** WARNING *** ScriptManager::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
25002500 #endif
2501−
25022501 // Lambda is necessary there to keep shared_ptr counter above zero
2503− QMetaObject::invokeMethod(this, [=, manager = shared_from_this()]{
2504− manager->unloadAllEntityScripts(blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection);
2505− });
2502+ QMetaObject::invokeMethod(this, [=, manager = shared_from_this()] {
2503+ manager->unloadAllEntityScripts(blockingCall);
2504+ }, blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection);
25062505 return;
25072506 }
25082507 #ifdef THREAD_DEBUGGING