When an ODE geom is removed (as when a non-phantom prim is deleted, resized or shape changed, also remove the OdeScene.actor_name_map entry pointing to the phys actor

This is to stop a small memory leak over time when prims are deleted or phantom-toggled
bulletsim
Justin Clark-Casey (justincc) 2011-08-01 06:32:30 +01:00
parent 6618948ff9
commit f32dbef647
1 changed files with 2 additions and 0 deletions

View File

@ -1448,6 +1448,7 @@ Console.WriteLine("CreateGeom:");
{
try
{
_parent_scene.actor_name_map.Remove(prim_geom);
d.GeomDestroy(prim_geom);
prim_geom = IntPtr.Zero;
}
@ -1455,6 +1456,7 @@ Console.WriteLine("CreateGeom:");
{
prim_geom = IntPtr.Zero;
m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name);
return false;
}