[Bf-python] bug checking before 2.37 release

Ken Hughes khughes at pacific.edu
Sun May 15 02:47:35 CEST 2005


Campbell Barton wrote:
> Hi Ken, if you know about python memory reference allocation, theres a 
> serious bug in Mathutils.Vector comparisions.
> doing an ...
> if vec == None:
> ....
> Will segfault Blender because None needs an extra reference.
> - I have a fix hinted in thge bug report but not sure if its only doing 
> the reverse and unnecceraly increasing the references for objects that 
> dont need it.
> 

Cam:

Tried putting in the "Py_INCREF( *v2 );" and set breakpoints in
Vector_coerce() to watch the reference count for None and other
objects (used your test.py from the bug tracker).  That seems to
fix it; the reference counts do seem consistent between calls
to the "vec ==" comparison.

Ken



More information about the Bf-python mailing list