Merge pull request #9979 from jherico/crash_fix

Fix crash in render-perf-test
This commit is contained in:
Brad Hefta-Gaub 2017-03-24 08:10:37 -07:00 committed by GitHub
commit aa1883ba85

View file

@ -996,7 +996,7 @@ void EntityTreeRenderer::checkAndCallPreload(const EntityItemID& entityID, const
}
bool shouldLoad = entity->shouldPreloadScript() && _entitiesScriptEngine;
QString scriptUrl = entity->getScript();
if ((unloadFirst && shouldLoad) || scriptUrl.isEmpty()) {
if (shouldLoad && (unloadFirst || scriptUrl.isEmpty())) {
_entitiesScriptEngine->unloadEntityScript(entityID);
entity->scriptHasUnloaded();
}