align weakref list for rna (properties were using wrong pointer)
authorCampbell Barton <ideasman42@gmail.com>
Wed, 2 Mar 2011 16:22:04 +0000 (16:22 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 2 Mar 2011 16:22:04 +0000 (16:22 +0000)
source/blender/python/intern/bpy_rna.h

index 77f1fa3b3365dbc60782b5a5b16f73136e294f65..aa8eaf3601a7ee9095ca5ea048f9da66a62029c0 100644 (file)
@@ -72,40 +72,45 @@ extern PyTypeObject pyrna_prop_collection_Type;
 #define PYRNA_STRUCT_IS_VALID(pysrna) (((BPy_StructRNA *)(pysrna))->ptr.type != NULL)
 #define PYRNA_PROP_IS_VALID(pysrna) (((BPy_PropertyRNA *)(pysrna))->ptr.type != NULL)
 
+/* 'in_weakreflist' MUST be aligned */
+
 typedef struct {
        PyObject_HEAD /* required python macro   */
+#ifdef USE_WEAKREFS
+       PyObject *in_weakreflist;
+#endif
        PointerRNA      ptr;
 } BPy_DummyPointerRNA;
 
 typedef struct {
        PyObject_HEAD /* required python macro   */
-       PointerRNA ptr;
-       int freeptr; /* needed in some cases if ptr.data is created on the fly, free when deallocing */
 #ifdef USE_WEAKREFS
        PyObject *in_weakreflist;
 #endif
+       PointerRNA ptr;
+       int freeptr; /* needed in some cases if ptr.data is created on the fly, free when deallocing */
 } BPy_StructRNA;
 
 typedef struct {
        PyObject_HEAD /* required python macro   */
-       PointerRNA ptr;
-       PropertyRNA *prop;
 #ifdef USE_WEAKREFS
        PyObject *in_weakreflist;
 #endif
+       PointerRNA ptr;
+       PropertyRNA *prop;
 } BPy_PropertyRNA;
 
 typedef struct {
        PyObject_HEAD /* required python macro   */
+#ifdef USE_WEAKREFS
+       PyObject *in_weakreflist;
+#endif
        PointerRNA ptr;
        PropertyRNA *prop;
 
        /* Arystan: this is a hack to allow sub-item r/w access like: face.uv[n][m] */
        int arraydim; /* array dimension, e.g: 0 for face.uv, 2 for face.uv[n][m], etc. */
        int arrayoffset; /* array first item offset, e.g. if face.uv is [4][2], arrayoffset for face.uv[n] is 2n */
-#ifdef USE_WEAKREFS
-       PyObject *in_weakreflist;
-#endif
 } BPy_PropertyArrayRNA;
 
 /* cheap trick */