diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-04 09:03:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-04 09:43:57 +0300 |
commit | 8106a6b75d45cc7472fd92f3b045697e30be8c73 (patch) | |
tree | 3b81857d4df29ce8bcc8d0043045aa6c713e4a78 /source/gameengine/Expressions | |
parent | c41431f1e9e75a424717b4080434b940c2685c20 (diff) |
mathutils: refactor instantiation
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.
also fixes unlikely memory leak if the data-array can't be allocated.
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index c025d439fc0..a65d61bc98b 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -418,7 +418,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * return NULL; } #ifdef USE_MATHUTILS - return Vector_CreatePyObject(val, attrdef->m_imax, Py_NEW, NULL); + return Vector_CreatePyObject(val, attrdef->m_imax, NULL); #else PyObject *resultlist = PyList_New(attrdef->m_imax); for (unsigned int i=0; i<attrdef->m_imax; i++) @@ -435,7 +435,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * return NULL; } #ifdef USE_MATHUTILS - return Matrix_CreatePyObject(val, attrdef->m_imin, attrdef->m_imax, Py_WRAP, NULL); + return Matrix_CreatePyObject_wrap(val, attrdef->m_imin, attrdef->m_imax, NULL); #else PyObject *collist = PyList_New(attrdef->m_imin); for (unsigned int i=0; i<attrdef->m_imin; i++) @@ -458,7 +458,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * #ifdef USE_MATHUTILS float fval[3]; val->getValue(fval); - return Vector_CreatePyObject(fval, 3, Py_NEW, NULL); + return Vector_CreatePyObject(fval, 3, NULL); #else PyObject *resultlist = PyList_New(3); for (unsigned int i=0; i<3; i++) |