History

loading fix

HifiExperiments committed 5 years ago

Commit b6744581 parent 81940214 files · +12 −10Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+9−7
@@ -451,7 +451,7 @@ void ScriptEngine::executeOnScriptThread(std::function<void()> function, const Q · 450 unmodified lines
451 function();451 function();
452}452}
453 453
454void ScriptEngine::waitTillDoneRunning() {454void ScriptEngine::waitTillDoneRunning(bool shutdown) {
455 // Engine should be stopped already, but be defensive455 // Engine should be stopped already, but be defensive
456 stop();456 stop();
457 457
@@ -520,12 +520,14 @@ void ScriptEngine::waitTillDoneRunning() { · 62 unmodified lines
520 }520 }
521 }521 }
522 522
523 // NOTE: This will be called on the main application thread (among other threads) from stopAllScripts.523 if (shutdown) {
524 // The thread will need to continue to process events, because524 // NOTE: This will be called on the main application thread (among other threads) from stopAllScripts.
525 // the scripts will likely need to marshall messages across to the main thread, e.g.525 // The thread will need to continue to process events, because
526 // if they access Settings or Menu in any of their shutdown code. So:526 // the scripts will likely need to marshall messages across to the main thread, e.g.
527 // Process events for this thread, allowing invokeMethod calls to pass between threads.527 // if they access Settings or Menu in any of their shutdown code. So:
528 QCoreApplication::processEvents();528 // Process events for this thread, allowing invokeMethod calls to pass between threads.
529 QCoreApplication::processEvents();
530 }
529 531
530 // Avoid a pure busy wait532 // Avoid a pure busy wait
531 QThread::yieldCurrentThread();533 QThread::yieldCurrentThread();