diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2022-07-14 13:17:59 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2022-07-14 13:17:59 +0300 |
commit | 9024ac31be5c883b772c50d81d001cdd8fdb3388 (patch) | |
tree | b110a913cd4e7369f05e7548d49fd1475a920137 /source | |
parent | cb62095c1c8afc4e2b5f28904e3ac4cbd47503b2 (diff) |
Fix curve drawing crash after changing geometry nodes output.
Using geometry nodes with attributes on a curve object and changing the
output is crashing. This is because the `render_mutex` in the curve
drawing cache is cleared after changes in `curves_batch_cache_init` and
set to null. The cache isn't actually needed currently because all draw
updates are single-threaded, but the new `drw_attributes_merge` function
still tries to access it (this seems to be tolerated on Linux platforms
but crashes on Windows).
Make sure the render_mutex is always initialized after (re-)initializing
the cache.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_curves.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc index d5f188402d6..1d3d6222f8f 100644 --- a/source/blender/draw/intern/draw_cache_impl_curves.cc +++ b/source/blender/draw/intern/draw_cache_impl_curves.cc @@ -75,13 +75,14 @@ static void curves_batch_cache_init(Curves &curves) if (!cache) { cache = MEM_cnew<CurvesBatchCache>(__func__); - BLI_mutex_init(&cache->render_mutex); curves.batch_cache = cache; } else { memset(cache, 0, sizeof(*cache)); } + BLI_mutex_init(&cache->render_mutex); + cache->is_dirty = false; } |