Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-03-11 14:32:30 +0300
committerSergey Sharybin <sergey@blender.org>2022-03-11 14:34:37 +0300
commitf4c8b4eb3e309ebc043cd998faa6d8d2bada14ac (patch)
treedbd51cad9fc787a6da9b57e0422d5d9af854b0c1 /source/blender/editors/space_image/image_draw.c
parentf6564df3515fcabfdb18cbff9b2e1a1579430848 (diff)
Fix threading conflict with movie cache line
It was possible that a render thread will be freeing cache while the interface is iterating over cache items to build cache line. Found while looking into T94738. It might be a fix, but I am unable to reproduce the original issue, so can not know for sure whether there is something else going or or not.
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r--source/blender/editors/space_image/image_draw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index cc86852e0d1..342f2df0020 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -541,7 +541,10 @@ void draw_image_cache(const bContext *C, ARegion *region)
int num_segments = 0;
int *points = NULL;
+ BLI_mutex_lock(image->runtime.cache_mutex);
IMB_moviecache_get_cache_segments(image->cache, IMB_PROXY_NONE, 0, &num_segments, &points);
+ BLI_mutex_unlock(image->runtime.cache_mutex);
+
ED_region_cache_draw_cached_segments(
region, num_segments, points, sfra + sima->iuser.offset, efra + sima->iuser.offset);
}