From 16bf59f8a63ea005f346e6bd9a5bfabd684b8382 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 25 Apr 2016 10:26:32 -0700 Subject: [PATCH] fix a crash in RenderableModelEntityItem::getModel --- libraries/entities/src/EntityTree.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 71b6f1364f..b4f0c484d5 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -1459,10 +1459,12 @@ void EntityTree::trackIncomingEntityLastEdited(quint64 lastEditedTime, int bytes void EntityTree::callLoader(EntityItemID entityID) { // this is used to bounce from the networking thread to the main thread - EntityItemPointer entity = findEntityByEntityItemID(entityID); - if (entity) { - entity->loader(); - } + this->withWriteLock([&] { + EntityItemPointer entity = findEntityByEntityItemID(entityID); + if (entity) { + entity->loader(); + } + }); } int EntityTree::getJointIndex(const QUuid& entityID, const QString& name) const {