mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 14:46:55 +02:00
Remove invalid comment and unnecessary check from ScriptEngine
This removes an invalid comment - waitTillDoneRunning is not only called from the main thread - and remove a check to make sure thread() is not null because it should no longer be deleted before ScriptEngine.
This commit is contained in:
parent
09c98b3ac3
commit
3c9205d0b2
1 changed files with 3 additions and 7 deletions
|
@ -397,16 +397,12 @@ void ScriptEngine::waitTillDoneRunning() {
|
|||
}
|
||||
}
|
||||
|
||||
// NOTE: This will be called on the main application thread from stopAllScripts.
|
||||
// The application thread will need to continue to process events, because
|
||||
// NOTE: This will be called on the main application thread (among other threads) from stopAllScripts.
|
||||
// The thread will need to continue to process events, because
|
||||
// the scripts will likely need to marshall messages across to the main thread, e.g.
|
||||
// if they access Settings or Menu in any of their shutdown code. So:
|
||||
// Process events for the main application thread, allowing invokeMethod calls to pass between threads.
|
||||
// Process events for this thread, allowing invokeMethod calls to pass between threads.
|
||||
QCoreApplication::processEvents();
|
||||
// In some cases (debugging), processEvents may give the thread enough time to shut down, so recheck it.
|
||||
if (!thread()) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Avoid a pure busy wait
|
||||
QThread::yieldCurrentThread();
|
||||
|
|
Loading…
Reference in a new issue