diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-17 13:58:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-17 13:58:26 +0400 |
commit | f5f25b81e8963aeba0a4c09f09358de070e0f927 (patch) | |
tree | c7fd6345d3a372845a0621e90087f88c90e4b8b8 /source/gameengine/Ketsji/KX_PyMath.h | |
parent | 245c94a75e60c2c0b58c1f39d189258e2e424e29 (diff) |
style cleanup:
also fix for building ghost test and fix double free in one of the tests
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyMath.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_PyMath.h | 13 |
1 files changed, 7 insertions, 6 deletions
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 |