diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-05-01 05:37:47 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-05-01 05:53:32 +0400 |
commit | 60c8c130fed60dc1fe5387b960549385188feadf (patch) | |
tree | 20a986e078ec4c79a321e3a2d12cb4a0d22b724c /source/gameengine/Ketsji/KX_RaySensor.cpp | |
parent | 8d42e7b20d884937f7bf5491b0bddeec3e54b67b (diff) |
BGE cleanup: KX_GameObject::GetParent() no longer increases the object's refcount.
I'm not sure why this function ever increased the object's refcount. Any
place in the code that calls KX_GameObject::GetParent() has to turn
around and call parent->Release(). Forgetting to call Release() was a
common cause of memory leaks (in fact, KX_SteeringActuator was probably
leaking). If the refcount needs to be increased, the calling code can
handle calling AddRef().
Diffstat (limited to 'source/gameengine/Ketsji/KX_RaySensor.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_RaySensor.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 84e615b61ab..0f47dfd922b 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -265,9 +265,6 @@ bool KX_RaySensor::Evaluate() if (!spc && parent) spc = parent->GetPhysicsController(); - if (parent) - parent->Release(); - PHY_IPhysicsEnvironment* physics_environment = this->m_scene->GetPhysicsEnvironment(); |