Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Bernal <jbernalmartinez@gmail.com>2015-05-29 18:01:05 +0300
committerJorge Bernal <jbernalmartinez@gmail.com>2015-05-29 18:03:54 +0300
commit9755986637a52f81147b3f89802748aacdffa20d (patch)
treebffdeb50ca02d8560ceb8a48a38d08dd12adcad6 /source/gameengine
parent51bec8e22e3b6ac763b84c41c206f9a3a022e5e0 (diff)
BGE: Fix memory leak when unable to add wheel
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Ketsji/KX_VehicleWrapper.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 237f485134a..b42200783e4 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -87,8 +87,6 @@ PyObject *KX_VehicleWrapper::PyAddWheel(PyObject *args)
if (gameOb->GetSGNode())
{
- PHY_IMotionState* motionState = new KX_MotionState(gameOb->GetSGNode());
-
MT_Vector3 attachPos,attachDir,attachAxle;
if(!PyVecTo(pylistPos,attachPos)) {
PyErr_SetString(PyExc_AttributeError,
@@ -115,6 +113,7 @@ PyObject *KX_VehicleWrapper::PyAddWheel(PyObject *args)
return NULL;
}
+ PHY_IMotionState *motionState = new KX_MotionState(gameOb->GetSGNode());
m_vehicle->AddWheel(motionState,attachPos,attachDir,attachAxle,suspensionRestLength,wheelRadius,hasSteering);
}