diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2004-10-14 21:35:16 +0400 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2004-10-14 21:35:16 +0400 |
commit | 7dda27fcd7266befeb9c8f191726154831438b59 (patch) | |
tree | 79e00f3b1cece2fd594ba7b3a4b87c0cfb962445 /source/blender/python/api2_2x/vector.h | |
parent | 6fbd4e3e1f5169aed15856f7b1c412176035b236 (diff) |
followup to vector memory leak fixes:
fix for problems with NMesh vertices.
plug some more leaks in matrix module.
new vector method newVectorProxy().
In BPy-Land, we have overloaded the meaning of our Vector
type. One use is for vectors in the traditional mathmatical
sense. The other legacy use is as a proxy for Blender data.
The recent memory leak fixed have lead to the Vector type
behaving as mathematical vectors.
However, the NMesh module is still using Vector types as a
proxy to manipulate NMVert data. To support this usage, in
the vector module there is a new factory method
newVectorProxy(). This creates a Vector that references
memory outside the Vector. Vectors created by
newVectorProxy() do NOT free their referenced memory. The
newVectorProxy() is used only in bpy code and is not exposed
thru the scripting interface.
Anyone using newVectorProxy() must be aware of object
lifetime and scoping issues because the returned Vector
holds a pointer to memory it does not own. This works in
the NMVert case since we are referencing memory belonging to
the NMVert object via an NMVert method.
Diffstat (limited to 'source/blender/python/api2_2x/vector.h')
-rw-r--r-- | source/blender/python/api2_2x/vector.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h index cf07b5ce78e..40e5851359a 100644 --- a/source/blender/python/api2_2x/vector.h +++ b/source/blender/python/api2_2x/vector.h @@ -61,6 +61,7 @@ typedef struct { //prototypes PyObject *newVectorObject( float *vec, int size ); +PyObject *newVectorProxy( float *vec, int size ); PyObject *Vector_Zero( VectorObject * self ); PyObject *Vector_Normalize( VectorObject * self ); PyObject *Vector_Negate( VectorObject * self ); |