Fix crash in recent changes to instancing
Registrable classes already handled their own instancing, changes to enable instancing everywhere conflicted.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user