[Bf-blender-cvs] [6ee25c9d550] temp-dynamic-overrides: Fix broken multi-threaded concurrent access to same data.

Bastien Montagne noreply at git.blender.org
Fri Jun 15 14:46:49 CEST 2018


Commit: 6ee25c9d5505dde6c562f1ddee0ff1adee98cf43
Author: Bastien Montagne
Date:   Fri Jun 15 14:44:48 2018 +0200
Branches: temp-dynamic-overrides
https://developer.blender.org/rB6ee25c9d5505dde6c562f1ddee0ff1adee98cf43

Fix broken multi-threaded concurrent access to same data.

Note that later we do can cache the non-data version of this path (i.e.
list of propnames), this will still save us the full RNA path parsing.

But the data side of path resolution has to be fully local, no way to
cache that since a same override can be applied to several objects!

===================================================================

M	source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index c58becf8ead..b184a54190d 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -7855,9 +7855,10 @@ void RNA_struct_dynamic_override_apply(PointerRNA *ptr, DynamicOverrideProperty
 
 	/* XXX For now, later we can use cached path in dyn_prop->data_path, even if only partially evaluated
 	 * (i.e. with no actual data), would still save us the whole string path parsing. */
-	if (RNA_path_resolve_elements(ptr, dyn_prop->rna_path, &dyn_prop->data_path)) {
-		rna_property_override_operation_apply(&((PropertyElemRNA *)dyn_prop->data_path.last)->ptr, NULL, NULL,
-		                                      ((PropertyElemRNA *)dyn_prop->data_path.last)->prop, NULL, NULL,
+	ListBase data_path = {0};
+	if (RNA_path_resolve_elements(ptr, dyn_prop->rna_path, &data_path)) {
+		rna_property_override_operation_apply(&((PropertyElemRNA *)data_path.last)->ptr, NULL, NULL,
+		                                      ((PropertyElemRNA *)data_path.last)->prop, NULL, NULL,
 		                                      NULL, dyn_prop);
 	}
 #ifndef NDEBUG
@@ -7866,6 +7867,7 @@ void RNA_struct_dynamic_override_apply(PointerRNA *ptr, DynamicOverrideProperty
 		       ((ID *)ptr->id.data)->name, dyn_prop->rna_path);
 	}
 #endif
+	BLI_freelistN(&data_path);
 #ifdef DEBUG_OVERRIDE_TIMEIT
 	TIMEIT_END_AVERAGED(RNA_struct_dynamic_override_apply);
 #endif



More information about the Bf-blender-cvs mailing list