Merge pull request #15487 from Atlante45/hotfix/deadlock

Case 22433: Query shape type outside lock
This commit is contained in:
John Conklin II 2019-04-30 19:36:53 -07:00 committed by GitHub
commit 576f41f90c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -269,6 +269,7 @@ enum class EntityVersion : PacketVersion {
CertificateTypeProperty,
DisableWebMedia,
ParticleShapeType,
ParticleShapeTypeDeadlockFix,
// Add new versions above here
NUM_PACKET_TYPE,