[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/python BPY_interface.c blender/source/blender/python/api2_2xBone.c

Stephen Swaney bf-committers@blender.org
Tue, 04 May 2004 23:33:10 -0500


Daniel Dunbar wrote:
> 
> zuster (Daniel Dunbar) 2004/05/05 05:22:22 CEST
> 
>   Modified files:
>     blender/source/blender/python BPY_interface.c
>     blender/source/blender/python/api2_2x Bone.c
> 
>   Log:
>    - PyInt_AsLong() was called on a possibly NULL object, this may be
>       a checked error but is no good anyway

After looking at the actual Python sources, the code you replaced
here does exactly the same thing as your changes.  Your version
is more obvious, but the result appears to be identical.
Py_XDECREF() decremetents the refcount of a possibly null object.

>    - Bone_dealloc free'd Blender's actual copy of the Bone! AGH!!!!

This one is definitely ++ungood.  Not nice to mess with
Blender's memory.

>    - On syntax errors the python global dictionary was being free'd
>       twice. AGH!!! again

The dictionary gets released in both branches of the if clause.
The line you removed zeroed out the pointer to the no longer used
python object that gets created when a script is run again.

Or so it all appears to me!

-- 
Stephen Swaney			
sswaney@swbell.net