Fix T89253: template_list allows arbitrary data changes
Blender forbids property changes in .draw() methods. But they weren't caught after a call to .template_list() with a custom list type. Support nested calls that disallow writes.
This commit is contained in:
@@ -8681,6 +8681,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
}
|
||||
|
||||
#ifdef USE_PEDANTIC_WRITE
|
||||
/* Handle nested draw calls, see: T89253. */
|
||||
const bool rna_disallow_writes_prev = rna_disallow_writes;
|
||||
rna_disallow_writes = is_readonly ? true : false;
|
||||
#endif
|
||||
/* *** Main Caller *** */
|
||||
@@ -8690,7 +8692,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
/* *** Done Calling *** */
|
||||
|
||||
#ifdef USE_PEDANTIC_WRITE
|
||||
rna_disallow_writes = false;
|
||||
rna_disallow_writes = rna_disallow_writes_prev;
|
||||
#endif
|
||||
|
||||
RNA_parameter_list_end(&iter);
|
||||
|
Reference in New Issue
Block a user