Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 4 files). Show all
Unified · Split
| @@ -2470,13 +2470,14 @@ QList<EntityItemID> ScriptEngine::getListOfEntityScriptIDs() { · 2469 unmodified lines | |||
| 2470 | return _entityScripts.keys(); | 2470 | return _entityScripts.keys(); |
| 2471 | } | 2471 | } |
| 2472 | 2472 | ||
| 2473 | void ScriptEngine::unloadAllEntityScripts() { | 2473 | void ScriptEngine::unloadAllEntityScripts(bool blockingCall) { |
| 2474 | if (QThread::currentThread() != thread()) { | 2474 | if (QThread::currentThread() != thread()) { |
| 2475 | #ifdef THREAD_DEBUGGING | 2475 | #ifdef THREAD_DEBUGGING |
| 2476 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; | 2476 | qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; |
| 2477 | #endif | 2477 | #endif |
| 2478 | 2478 | ||
| 2479 | QMetaObject::invokeMethod(this, "unloadAllEntityScripts"); | 2479 | QMetaObject::invokeMethod(this, "unloadAllEntityScripts", |
| 2480 | blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection); | ||
| 2480 | return; | 2481 | return; |
| 2481 | } | 2482 | } |
| 2482 | #ifdef THREAD_DEBUGGING | 2483 | #ifdef THREAD_DEBUGGING |