diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-24 11:48:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-24 11:48:19 +0300 |
commit | db8aa7b851207294ffc943dc201e4f2955ed01dd (patch) | |
tree | 1227ad0181694da5655a08c4ecd1b48f331f8e58 /source | |
parent | cd3f856eb82171ce7e532c9a38ede80d7cf954bf (diff) |
Depsgraph: Fix violation of evaluated domain
Evaluation must never go to original objects and query them:
this is a huge violation of the entire idea of separating
state across viewports and render engines.
Allowed this to only happen for active dependency graph, where
we at least know order of dependency graph update and user
input.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 959435ad486..6b03d03f882 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2070,7 +2070,6 @@ static void object_get_datamask(const Depsgraph *depsgraph, bool *r_need_mapping) { ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph); - Object *actob = view_layer->basact ? DEG_get_original_object(view_layer->basact->object) : NULL; DEG_get_customdata_mask_for_object(depsgraph, ob, r_mask); @@ -2078,6 +2077,13 @@ static void object_get_datamask(const Depsgraph *depsgraph, *r_need_mapping = false; } + /* Must never access original objects when dependency graph is not active: it might be already + * freed. */ + if (DEG_is_active(depsgraph)) { + return; + } + + Object *actob = view_layer->basact ? DEG_get_original_object(view_layer->basact->object) : NULL; if (DEG_get_original_object(ob) == actob) { bool editing = BKE_paint_select_face_test(actob); |