From f8c00270d3d7da1df1d699b177ce3883a28f4e12 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Tue, 7 Mar 2006 04:25:44 +0000 Subject: [PATCH] assertions in remove physical --- panda/src/physics/physicsManager.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/physics/physicsManager.cxx b/panda/src/physics/physicsManager.cxx index 7c96ad2679..435e67fd21 100644 --- a/panda/src/physics/physicsManager.cxx +++ b/panda/src/physics/physicsManager.cxx @@ -106,6 +106,7 @@ remove_angular_force(AngularForce *f) { //////////////////////////////////////////////////////////////////// void PhysicsManager:: remove_physical(Physical *p) { + nassertv(this); nassertv(p); pvector< Physical * >::iterator found; @@ -113,8 +114,11 @@ remove_physical(Physical *p) { if (found == _physicals.end()) { return; } + nassertv(*found == p); + nassertv(p->_physics_manager != (PhysicsManager *) NULL); p->_physics_manager = (PhysicsManager *) NULL; _physicals.erase(found); + nassertv(_physicals.end() == find(_physicals.begin(), _physicals.end(), p)); } ////////////////////////////////////////////////////////////////////