fix for 2 segfaults running in background mode.
- operators which reload G.main would crash blender if called from python and then accessed bpy.data.* - WM_read_homefile_exec was setting the contexts Scene to NULL as a signal for the event system, this didnt work in background mode, crashing when property update functions expected scene to be set.
This commit is contained in:
@@ -231,6 +231,12 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* when calling bpy.ops.wm.read_factory_settings() bpy.data's main pointer is freed by clear_globals(),
|
||||
* further access will crash blender. setting context is not needed in this case, only calling because this
|
||||
* function corrects bpy.data (internal Main pointer) */
|
||||
BPY_modules_update(C);
|
||||
|
||||
|
||||
/* return operator_ret as a bpy enum */
|
||||
return pyrna_enum_bitfield_to_py(operator_return_items, operator_ret);
|
||||
|
||||
|
||||
@@ -5316,8 +5316,6 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void BPY_modules_update(bContext *C); //XXX temp solution
|
||||
|
||||
/* TODO - multiple return values like with rna functions */
|
||||
static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
|
||||
{
|
||||
|
||||
@@ -110,4 +110,6 @@ int pyrna_array_contains_py(PointerRNA *ptr, PropertyRNA *prop, PyObject *value)
|
||||
|
||||
int pyrna_write_check(void);
|
||||
|
||||
void BPY_modules_update(struct bContext *C); //XXX temp solution
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user