From 8106a6b75d45cc7472fd92f3b045697e30be8c73 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Jan 2015 17:03:54 +1100 Subject: 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. --- source/blender/freestyle/intern/python/BPy_Convert.cpp | 6 +++--- source/blender/freestyle/intern/python/BPy_Freestyle.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/freestyle/intern/python') diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index dbd836bc562..b0b43acb8da 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -81,7 +81,7 @@ PyObject *Vector_from_Vec2f(Vec2f& vec) float vec_data[2]; // because vec->_coord is protected vec_data[0] = vec.x(); vec_data[1] = vec.y(); - return Vector_CreatePyObject(vec_data, 2, Py_NEW, NULL); + return Vector_CreatePyObject(vec_data, 2, NULL); } PyObject *Vector_from_Vec3f(Vec3f& vec) @@ -90,7 +90,7 @@ PyObject *Vector_from_Vec3f(Vec3f& vec) vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z(); - return Vector_CreatePyObject(vec_data, 3, Py_NEW, NULL); + return Vector_CreatePyObject(vec_data, 3, NULL); } PyObject *Vector_from_Vec3r(Vec3r& vec) @@ -99,7 +99,7 @@ PyObject *Vector_from_Vec3r(Vec3r& vec) vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z(); - return Vector_CreatePyObject(vec_data, 3, Py_NEW, NULL); + return Vector_CreatePyObject(vec_data, 3, NULL); } PyObject *BPy_Id_from_Id(Id& id) diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index ee0e7dfab3e..f4ead300d5e 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -153,7 +153,7 @@ static PyObject *Freestyle_blendRamp(PyObject *self, PyObject *args) return NULL; } ramp_blend(type, a, fac, b); - return Vector_CreatePyObject(a, 3, Py_NEW, NULL); + return Vector_CreatePyObject(a, 3, NULL); } #include "BKE_texture.h" /* do_colorband() */ @@ -187,7 +187,7 @@ static PyObject *Freestyle_evaluateColorRamp(PyObject *self, PyObject *args) PyErr_SetString(PyExc_ValueError, "failed to evaluate the color ramp"); return NULL; } - return Vector_CreatePyObject(out, 4, Py_NEW, NULL); + return Vector_CreatePyObject(out, 4, NULL); } #include "DNA_color_types.h" -- cgit v1.2.3