From 099e04f7bbcffe16efdea5e61634d9a7ce94da3c Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 30 Apr 2019 17:57:37 -0700 Subject: [PATCH] Query shape type outside lock --- libraries/entities/src/EntityItem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 8a50c39da9..9ae9246176 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -2023,9 +2023,10 @@ void EntityItem::setCollisionMask(uint16_t value) { void EntityItem::setDynamic(bool value) { if (getDynamic() != value) { + auto shapeType = getShapeType(); withWriteLock([&] { // dynamic and STATIC_MESH are incompatible so we check for that case - if (value && getShapeType() == SHAPE_TYPE_STATIC_MESH) { + if (value && shapeType == SHAPE_TYPE_STATIC_MESH) { if (_dynamic) { _dynamic = false; _flags |= Simulation::DIRTY_MOTION_TYPE;