fix for error report in property registration, it wasnt printing the error.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 3 Mar 2012 00:20:05 +0000 (00:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 3 Mar 2012 00:20:05 +0000 (00:20 +0000)
source/blender/python/intern/bpy_rna.c

index cb178519b6a9aa13b004a66d59109f46b5ba831c..ab6d23ba4dbe5e150c25304fb808757cf0268ac7 100644 (file)
@@ -6500,15 +6500,17 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item
 
                        py_ret = PyObject_Call(py_func, args_fake, py_kw);
 
-                       Py_DECREF(args_fake); /* free's py_srna_cobject too */
-
                        if (py_ret) {
                                Py_DECREF(py_ret);
+                               Py_DECREF(args_fake); /* free's py_srna_cobject too */
                        }
                        else {
+                               /* _must_ print before decreffing args_fake */
                                PyErr_Print();
                                PyErr_Clear();
 
+                               Py_DECREF(args_fake); /* free's py_srna_cobject too */
+
                                // PyC_LineSpit();
                                PyErr_Format(PyExc_ValueError,
                                             "bpy_struct \"%.200s\" registration error: "