From f5f25b81e8963aeba0a4c09f09358de070e0f927 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Jun 2012 09:58:26 +0000 Subject: style cleanup: also fix for building ghost test and fix double free in one of the tests --- source/gameengine/Ketsji/KX_PyMath.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/gameengine/Ketsji/KX_PyMath.h') diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index b0000405893..8924567acde 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -104,19 +104,20 @@ bool PyMatTo(PyObject* pymat, T& mat) if (!PyErr_Occurred() && PySequence_Check(pyrow)) { unsigned int cols = PySequence_Size(pyrow); - if (cols != Size(mat)) + if (cols != Size(mat)) { noerror = false; - else - { - for(unsigned int col = 0; col < cols; col++) - { + } + else { + for (unsigned int col = 0; col < cols; col++) { PyObject *item = PySequence_GetItem(pyrow, col); /* new ref */ mat[row][col] = PyFloat_AsDouble(item); Py_DECREF(item); } } - } else + } + else { noerror = false; + } Py_DECREF(pyrow); } } else -- cgit v1.2.3