Delete all SOLID shapes at the end of the game engine. They were all being leaked!
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Sat, 8 May 2004 00:25:20 +0000 (00:25 +0000)
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Sat, 8 May 2004 00:25:20 +0000 (00:25 +0000)
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Physics/Sumo/Fuzzics/src/SM_FhObject.cpp

index ff22e003d75dfcaf01ea18c2f2b8301a0ddc6155..8e552d3f3d4c14032e4f37686dc33099ad83c32b 100644 (file)
@@ -117,6 +117,8 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter()
                delete (*itm);
                itm++;
        }
+       
+       KX_ClearSumoSharedShapes();
 }
 
 
index 3ed3e2bfa8fec756b296153cb946fe5cb4aceeea..0cf305dd14bf53459064f0971fa21e6bb6d5af3b 100644 (file)
@@ -108,6 +108,8 @@ void        KX_ConvertSumoObject(   class   KX_GameObject* gameobj,
        struct  PHY_ShapeProps* shapeprops,
        struct  PHY_MaterialProps*      smmaterial,
        struct  KX_ObjectProperties*    objprop);
+       
+void   KX_ClearSumoSharedShapes();
 #endif
 
 #endif //KX_CONVERTPHYSICSOBJECTS
index 72231c1fa64064aa7ace5f49550a71b82702477d..3e0c7768f565e19a046748f8b3ea8594a58bb4cd 100644 (file)
@@ -77,7 +77,7 @@
 
 #include "KX_SumoPhysicsController.h"
 
-GEN_Map<GEN_HashedPtr,DT_ShapeHandle> map_gamemesh_to_sumoshape;
+static GEN_Map<GEN_HashedPtr,DT_ShapeHandle> map_gamemesh_to_sumoshape;
 
 // forward declarations
 void   BL_RegisterSumoObject(KX_GameObject* gameobj,class SM_Scene* sumoScene,class SM_Object* sumoObj,const STR_String& matname,bool isDynamic,bool isActor);
index c6134bde8f876f78efb9af5265a959af717d1ad5..e905459ce212efb4c80b6a2e5392e1cc91d83c6a 100644 (file)
@@ -46,6 +46,7 @@ SM_FhObject::SM_FhObject(DT_ShapeHandle rayshape, MT_Vector3 ray, SM_Object *par
 
 SM_FhObject::~SM_FhObject()
 {
+       DT_DeleteShape(getShapeHandle());
 }
 
 DT_Bool SM_FhObject::ray_hit(void *client_data,