armature weakref evilness again, using editmode in python is not the best.

replacing PyWeakref_NewProxy with PyWeakref_NewRef fixes this problem.

list(bpy.data.armatures) # would mess up weakrefs
[arm for arm in bpy.data.armatures] # didnt.
This commit is contained in:
Campbell Barton 2007-08-27 16:09:02 +00:00
parent 93b5553c9c
commit ca843fd2f8

@ -1358,7 +1358,7 @@ PyObject *Armature_CreatePyObject(struct bArmature *armature)
goto RuntimeError;
}
weakref = PyWeakref_NewProxy((PyObject*)py_armature, arm_weakref_callback_weakref_dealloc__pyfunc);
weakref = PyWeakref_NewRef((PyObject*)py_armature, arm_weakref_callback_weakref_dealloc__pyfunc);
if (PyList_Append(armlist, weakref) == -1){
printf("Oops - list-append failed\n");
goto RuntimeError;