diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-07-27 05:18:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-07-27 05:18:21 +0400 |
commit | b227c98c443b2106df37a9ebeb04dcd50d6f2e49 (patch) | |
tree | b80eac1e6114fd95c52d7bb467da63c2481a1957 /source/blender/python/api2_2x/gen_utils.c | |
parent | 4ee3515bf1751f7f89168f3c5c1fd907ad138ffd (diff) |
Addition to Mathutils
vec.normalized()
mat.inverted()
mat.transposed()
made vec/float possible
normalize/invert/transpose now return None because they modify the data in place.
use the ...(ed) versions to return a modified copy.
Fixed Memory leaks from not decreffing PyFloat_AS_DOUBLE from these python functions...
(found when testing above functions)
ob.rbMass
ob.rbRadius
matrix.determinant()
quat*float
vec*float
matrix.transpose()
EXPP_setModuleConstant
Checked all instances of PyFloat_AS_DOUBLE so I dont think there are any mroe leaks there.
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.c')
-rw-r--r-- | source/blender/python/api2_2x/gen_utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c index 4489b215313..7748dc91618 100644 --- a/source/blender/python/api2_2x/gen_utils.c +++ b/source/blender/python/api2_2x/gen_utils.c @@ -788,6 +788,7 @@ int EXPP_setModuleConstant ( BPy_constant *constant, void *param, char type ) return 0; case 'f': *(float *)param = (float)PyFloat_AS_DOUBLE( item ); + Py_DECREF(item); /* line above increfs */ return 0; default: return EXPP_ReturnIntError( PyExc_RuntimeError, |