armature weakref evilness again, using editmode in python is not the best.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 27 Aug 2007 16:09:02 +0000 (16:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 27 Aug 2007 16:09:02 +0000 (16:09 +0000)
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.

source/blender/python/api2_2x/Armature.c

index 0a616e2b9fe1fe0d57aae0a4c965cd4189050793..1ad5938c17ee7906dc3833ebbe84d95999385e99 100644 (file)
@@ -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;