fix asserts on domain switch

This commit is contained in:
SamGondelman 2018-04-09 17:10:49 -07:00
parent c62a701a2d
commit 8f65813924
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;