History

Rename ScriptEngine::wait to match std threading

Zach Pomerantz committed 10 years ago

Commit 2cc788f1 parent edf82c53 files · +8 −5Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngines.cpp+3−2
@@ -149,6 +149,7 @@ void ScriptEngines::shutdownScripting() { · 148 unmodified lines
149149 // NOTE: typically all script engines are running. But there's at least one known exception to this, the
150150 // "entities sandbox" which is only used to evaluate entities scripts to test their validity before using
151151 // them. We don't need to stop scripts that aren't running.
152+ // TODO: Scripts could be shut down faster if we spread them across a threadpool.
152153 if (scriptEngine->isRunning()) {
153154 qCDebug(scriptengine) << "about to shutdown script:" << scriptName;
154155
@@ -165,12 +166,12 @@ void ScriptEngines::shutdownScripting() { · 10 unmodified lines
165166 // want any of the scripts final "scriptEnding()" or pending "update()" methods from accessing
166167 // any application state after we leave this stopAllScripts() method
167168 qCDebug(scriptengine) << "waiting on script:" << scriptName;
168− scriptEngine->waitTillDoneRunning();
169+ scriptEngine->wait();
169170 qCDebug(scriptengine) << "done waiting on script:" << scriptName;
170171
171172 scriptEngine->deleteLater();
172173
173− // If the script is stopped, we can remove it from our set
174+ // Once the script is stopped, we can remove it from our set
174175 i.remove();
175176 }
176177 }