Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Gilbert <ascotan@gmail.com>2005-07-19 22:47:25 +0400
committerJoseph Gilbert <ascotan@gmail.com>2005-07-19 22:47:25 +0400
commit2801c8b20afdd4cf4f2157d65132f46082693318 (patch)
treecf21fd2c38af5d489ce16045b2d6b10bd4f12e34 /source/blender/python/api2_2x/euler.c
parent19abd72baaf2de95c5f46011708756f2ca9dcd8d (diff)
__ bug fix__
- internal methods for mathutils class need to incref before returning a pointer to self * memory allocation errors (freeing bad pointers) were appearing after repeatedly calling internal methods on the same object due to ref counts.
Diffstat (limited to 'source/blender/python/api2_2x/euler.c')
-rw-r--r--source/blender/python/api2_2x/euler.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c
index 103537aa8ba..8ec0bff86a8 100644
--- a/source/blender/python/api2_2x/euler.c
+++ b/source/blender/python/api2_2x/euler.c
@@ -135,7 +135,7 @@ PyObject *Euler_Unique(EulerObject * self)
self->eul[1] = (float)(pitch * 180 / (float)Py_PI);
self->eul[2] = (float)(bank * 180 / (float)Py_PI);
- return (PyObject*)self;
+ return EXPP_incr_ret((PyObject*)self);
}
//----------------------------Euler.zero()-------------------------
//sets the euler to 0,0,0
@@ -145,7 +145,7 @@ PyObject *Euler_Zero(EulerObject * self)
self->eul[1] = 0.0;
self->eul[2] = 0.0;
- return (PyObject*)self;
+ return EXPP_incr_ret((PyObject*)self);
}
//----------------------------Euler.rotate()-----------------------
//rotates a euler a certain amount and returns the result
@@ -176,7 +176,7 @@ PyObject *Euler_Rotate(EulerObject * self, PyObject *args)
self->eul[x] *= (180 / (float)Py_PI);
}
- return (PyObject*)self;
+ return EXPP_incr_ret((PyObject*)self);
}
//----------------------------dealloc()(internal) ------------------
//free the py_object