History

Clean up entity script engine deletion

Zach Pomerantz committed 10 years ago

Commit f40fe881 parent 2cc788f3 files · +18 −15Browse 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+4−2
@@ -158,8 +158,10 @@ void ScriptEngines::shutdownScripting() { · 157 unmodified lines
158158 // and stop. We can safely short circuit this because we know we're in the "quitting" process
159159 scriptEngine->disconnect(this);
160160
161− // Calling stop on the script engine will set it's internal _isFinished state to true, and result
162− // in the ScriptEngine gracefully ending it's run() method.
161+ // If this is an entity script, we need to unload any entities
162+ scriptEngine->unloadAllEntityScripts();
163+
164+ // Gracefully stop the engine's scripting thread
163165 scriptEngine->stop();
164166
165167 // We need to wait for the engine to be done running before we proceed, because we don't