diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-21 20:07:57 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-21 20:08:17 +0300 |
commit | 9de3ed5c823ed79c3584765141d4f1c160add4d3 (patch) | |
tree | b499af02e809123e2f973fcedc9bb7a39d8c23de /source/blender | |
parent | 9a9a46df469b136f5b6c82bdfbbbc70d95066893 (diff) |
Fix T97490: snap to multiple objects with linked data can crash
The problem is old.
rB52be06301257 (fixed by rB4b35d6950d4f) just masked it.
`Object->data`, on evaluated objects, is not a safe pointer to get
objects with the same `BMEditData`.
Use `Object->runtime.data_orig` instead.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index ab78ef6a5aa..abeb376a9a6 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -242,7 +242,7 @@ static SnapObjectData *snap_object_data_lookup(SnapObjectContext *sctx, Object * if (sod == nullptr) { if (sctx->cache.data_to_object_map != nullptr) { ob_eval = static_cast<Object *>( - BLI_ghash_lookup(sctx->cache.data_to_object_map, ob_eval->data)); + BLI_ghash_lookup(sctx->cache.data_to_object_map, ob_eval->runtime.data_orig)); /* Could be NULl when mixing edit-mode and non edit-mode objects. */ if (ob_eval != nullptr) { sod = static_cast<SnapObjectData *>(BLI_ghash_lookup(sctx->cache.object_map, ob_eval)); @@ -369,7 +369,7 @@ static SnapObjectData *snap_object_data_editmesh_get(SnapObjectContext *sctx, sctx->cache.data_to_object_map = BLI_ghash_ptr_new(__func__); } void **ob_p; - if (BLI_ghash_ensure_p(sctx->cache.data_to_object_map, ob_eval->data, &ob_p)) { + if (BLI_ghash_ensure_p(sctx->cache.data_to_object_map, ob_eval->runtime.data_orig, &ob_p)) { ob_eval = static_cast<Object *>(*ob_p); } else { |