Check entities scripting thread before signaling it

This commit is contained in:
Zach Pomerantz 2016-04-06 11:12:05 -07:00
parent 699c717828
commit 1e710712cc
2 changed files with 5 additions and 3 deletions

View file

@ -71,8 +71,8 @@ EntityTreeRenderer::EntityTreeRenderer(bool wantScripts, AbstractViewStateInterf
}
EntityTreeRenderer::~EntityTreeRenderer() {
// NOTE: we don't need to delete _entitiesScriptEngine because it is registered with the application and has a
// signal tied to call it's deleteLater on doneRunning
// NOTE: We don't need to delete _entitiesScriptEngine because
// it is registered with ScriptEngines, which will call deleteLater for us.
}
void EntityTreeRenderer::clear() {

View file

@ -154,7 +154,9 @@ ScriptEngine::~ScriptEngine() {
void ScriptEngine::disconnectNonEssentialSignals() {
disconnect();
connect(this, &ScriptEngine::doneRunning, thread(), &QThread::quit);
if (_isRunning && _isThreaded) { // ensure the thread is running
connect(this, &ScriptEngine::doneRunning, thread(), &QThread::quit);
}
}
void ScriptEngine::runInThread() {