Merge pull request #12841 from SamGondelman/simAssert

Fix asserts on domain switch
This commit is contained in:
John Conklin II 2018-04-11 16:02:45 -07:00 committed by GitHub
commit 5c26166bd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -62,7 +62,7 @@ EntityItem::EntityItem(const EntityItemID& entityItemID) :
EntityItem::~EntityItem() {
// these pointers MUST be correct at delete, else we probably have a dangling backpointer
// to this EntityItem in the corresponding data structure.
assert(!_simulated);
assert(!_simulated || (!_element && !_physicsInfo));
assert(!_element);
assert(!_physicsInfo);
}

View file

@ -158,7 +158,6 @@ void PhysicalEntitySimulation::clearEntitiesInternal() {
EntityMotionState* motionState = static_cast<EntityMotionState*>(&(*stateItr));
assert(motionState);
EntityItemPointer entity = motionState->getEntity();
entity->setPhysicsInfo(nullptr);
// TODO: someday when we invert the entities/physics lib dependencies we can let EntityItem delete its own PhysicsInfo
// until then we must do it here
delete motionState;