[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11841] trunk/blender/source/blender/ python/api2_2x/Armature.c: armature weakref evilness again, using editmode in python is not the best.

Campbell Barton cbarton at metavr.com
Mon Aug 27 18:09:02 CEST 2007


Revision: 11841
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11841
Author:   campbellbarton
Date:     2007-08-27 18:09:02 +0200 (Mon, 27 Aug 2007)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Armature.c

Modified: trunk/blender/source/blender/python/api2_2x/Armature.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Armature.c	2007-08-27 16:06:10 UTC (rev 11840)
+++ trunk/blender/source/blender/python/api2_2x/Armature.c	2007-08-27 16:09:02 UTC (rev 11841)
@@ -1358,7 +1358,7 @@
 		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;





More information about the Bf-blender-cvs mailing list