diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-26 20:19:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-26 20:27:14 +0300 |
commit | 48e8a1a1670101a38db5aa10970c4aa938bc9451 (patch) | |
tree | e998a2bb8b4cb1ca4c6098eafd1459f7f48938b1 /source/blender/python | |
parent | 6fe2a48d3e18121624e315de0c3c65c960c9d5ec (diff) |
Fix crash in recent changes to instancing
Registrable classes already handled their own instancing,
changes to enable instancing everywhere conflicted.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3c3269853df..fcd5441b4e1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -6660,7 +6660,7 @@ PyObject *pyrna_struct_CreatePyObject(PointerRNA *ptr) /* New in 2.8x, since not many types support instancing * we may want to use a flag to avoid looping over all classes. - campbell */ - void **instance = RNA_struct_instance(ptr); + void **instance = ptr->data ? RNA_struct_instance(ptr) : NULL; if (instance && *instance) { pyrna = *instance; Py_INCREF(pyrna); @@ -7466,7 +7466,6 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param PyObject *args; PyObject *ret = NULL, *py_srna = NULL, *py_class_instance = NULL, *parmitem; PyTypeObject *py_class; - void **py_class_instance_store = NULL; PropertyRNA *parm; ParameterIterator iter; PointerRNA funcptr; @@ -7517,10 +7516,6 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param py_class_instance = *instance; Py_INCREF(py_class_instance); } - else { - /* store the instance here once its created */ - py_class_instance_store = instance; - } } } /* end exception */ @@ -7591,10 +7586,6 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param if (py_class_instance == NULL) { err = -1; /* so the error is not overridden below */ } - else if (py_class_instance_store) { - *py_class_instance_store = py_class_instance; - Py_INCREF(py_class_instance); - } } } |