From 1fb97ffeedc9aefa4351b34bdc51764817dd2140 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 10 May 2015 09:13:16 +0200 Subject: [PATCH] Fix T44644 Missing thread-protection (spinlock) of image in new multiview code. Many thanks to Sergey, for practically giving the solution! Note that it may also fix T44345, depends whether there are other missing protections/locks or not... --- source/blender/blenkernel/intern/image.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 4275b0200d0..eeb2f83fd73 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2427,11 +2427,15 @@ void BKE_image_verify_viewer_views(const RenderData *rd, Image *ima, ImageUser * } if (do_reset) { + BLI_spin_lock(&image_spin); + image_free_cached_frames(ima); BKE_image_free_views(ima); /* add new views */ image_viewer_create_views(rd, ima); + + BLI_spin_unlock(&image_spin); } BLI_unlock_thread(LOCK_DRAW_IMAGE);