BGE bug fix: crash at exit when object with Radar/Near sensor has debug properties
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user