From 63f7eceb53085ef40cad4dc2343dbe608be999c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Jul 2021 16:04:08 +1000 Subject: PyAPI: defer freeing existing properties on registration Registering a property could remove the existing property, then fail to parse one of the arguments of the new property - leaving the struct without a property. Now freeing the existing property is deferred until immediately before the new property is registered. --- source/blender/makesrna/RNA_define.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesrna/RNA_define.h') diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index a31182b2f5a..01e26cbb41c 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -506,6 +506,11 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA void RNA_def_property_free_pointers(PropertyRNA *prop); int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier); +int RNA_def_property_free_identifier_deferred_prepare(StructOrFunctionRNA *cont_, + const char *identifier, + void **handle); +void RNA_def_property_free_identifier_deferred_finish(StructOrFunctionRNA *cont_, void *handle); + void RNA_def_property_free_pointers_set_py_data_callback( void (*py_data_clear_fn)(PropertyRNA *prop)); -- cgit v1.2.3