PyBullet/C-API: only free handle if we found it

This commit is contained in:
erwincoumans committed 2018-01-14 12:35:40 -08:00
1 parent 0919ce0f30
commit 3c770e56fb
1 file changed
+2 -1
@@ -7474,9 +7474,10 @@ bool PhysicsServerCommandProcessor::processRemoveBodyCommand(const struct Shared
bodyHandle->m_rigidBody=0;
serverCmd.m_type = CMD_REMOVE_BODY_COMPLETED;
}
m_data->m_bodyHandles.freeHandle(bodyUniqueId);
}
m_data->m_bodyHandles.freeHandle(bodyUniqueId);
}
m_data->m_guiHelper->setVisualizerFlag(COV_ENABLE_SYNC_RENDERING_INTERNAL,1);