diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-12-28 11:19:53 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-12-28 11:20:17 +0300 |
commit | d25fa3250aae7e22f68579c053c591a8b2682e3c (patch) | |
tree | 281d75f27eab39afd968f941a8b2c74e50973e00 | |
parent | f6699bfccf0f77327ce6cdf306c280e4c14b3c93 (diff) |
Fix T94420: deadlock with subsurf modifiers
The deadlock was caused as the lock on the Mesh mutex used to compute
the subdivision wrapper was not released in some early exits of the
function.
-rw-r--r-- | source/blender/blenkernel/intern/mesh_wrapper.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_wrapper.c b/source/blender/blenkernel/intern/mesh_wrapper.c index 5956f2802b5..4cc43354a44 100644 --- a/source/blender/blenkernel/intern/mesh_wrapper.c +++ b/source/blender/blenkernel/intern/mesh_wrapper.c @@ -336,6 +336,7 @@ Mesh *BKE_mesh_wrapper_ensure_subdivision(const Object *ob, Mesh *me) SubdivSettings subdiv_settings; BKE_subsurf_modifier_subdiv_settings_init(&subdiv_settings, smd, apply_render); if (subdiv_settings.level == 0) { + BLI_mutex_unlock(mesh_eval_mutex); return me; } @@ -344,6 +345,7 @@ Mesh *BKE_mesh_wrapper_ensure_subdivision(const Object *ob, Mesh *me) Subdiv *subdiv = BKE_subsurf_modifier_subdiv_descriptor_ensure(smd, &subdiv_settings, me, false); if (subdiv == NULL) { /* Happens on bad topology, but also on empty input mesh. */ + BLI_mutex_unlock(mesh_eval_mutex); return me; } @@ -352,6 +354,7 @@ Mesh *BKE_mesh_wrapper_ensure_subdivision(const Object *ob, Mesh *me) mesh_settings.use_optimal_display = me->runtime.subsurf_use_optimal_display; if (mesh_settings.resolution < 3) { + BLI_mutex_unlock(mesh_eval_mutex); return me; } |