diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-04-20 01:15:37 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-04-20 01:15:37 +0400 |
commit | bdf5c0689b1617118cd7f327139a928ec04c47bf (patch) | |
tree | cb2e5b68672b46886372405b3bc52cd82796a502 /source/gameengine | |
parent | b0049e608859bd129bb5c13fecdd161811741185 (diff) |
BGE bug fix: crash at exit when object with Radar/Near sensor has debug properties
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/GameLogic/SCA_IScene.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_IScene.h | 1 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 6 |
3 files changed, 14 insertions, 5 deletions
diff --git a/source/gameengine/GameLogic/SCA_IScene.cpp b/source/gameengine/GameLogic/SCA_IScene.cpp index 9a17d1f384f..9fbeb706910 100644 --- a/source/gameengine/GameLogic/SCA_IScene.cpp +++ b/source/gameengine/GameLogic/SCA_IScene.cpp @@ -47,16 +47,20 @@ SCA_IScene::SCA_IScene() { } - - -SCA_IScene::~SCA_IScene() +void SCA_IScene::RemoveAllDebugProperties() { - // release debugprop list for (std::vector<SCA_DebugProp*>::iterator it = m_debugList.begin(); !(it==m_debugList.end());it++) { delete (*it); } + m_debugList.clear(); +} + + +SCA_IScene::~SCA_IScene() +{ + RemoveAllDebugProperties(); } diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h index 23c9c37fd6e..d18778a37c2 100644 --- a/source/gameengine/GameLogic/SCA_IScene.h +++ b/source/gameengine/GameLogic/SCA_IScene.h @@ -59,6 +59,7 @@ public: std::vector<SCA_DebugProp*>& GetDebugProperties(); void AddDebugProperty(class CValue* debugprop, const STR_String &name); + void RemoveAllDebugProperties(); }; #endif //__KX_ISCENE_H diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 1758b3bb955..0fbabe8d6a2 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -178,7 +178,11 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, KX_Scene::~KX_Scene() { - + // The release of debug properties used to be in SCA_IScene::~SCA_IScene + // It's still there but we remove all properties here otherwise some + // reference might be hanging and causing late release of objects + RemoveAllDebugProperties(); + while (GetRootParentList()->GetCount() > 0) { KX_GameObject* parentobj = (KX_GameObject*) GetRootParentList()->GetValue(0); |