Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 3 files). Show all
Unified · Split
| @@ -158,8 +158,10 @@ void ScriptEngines::shutdownScripting() { · 157 unmodified lines | ||
| 158 | 158 | // and stop. We can safely short circuit this because we know we're in the "quitting" process |
| 159 | 159 | scriptEngine->disconnect(this); |
| 160 | 160 | |
| 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 | |
| 163 | 165 | scriptEngine->stop(); |
| 164 | 166 | |
| 165 | 167 | // We need to wait for the engine to be done running before we proceed, because we don't |