[Bf-blender-cvs] [1fb97ff] master: Fix T44644 Missing thread-protection (spinlock) of image in new multiview code.

Bastien Montagne noreply at git.blender.org
Sun May 10 09:19:54 CEST 2015


Commit: 1fb97ffeedc9aefa4351b34bdc51764817dd2140
Author: Bastien Montagne
Date:   Sun May 10 09:13:16 2015 +0200
Branches: master
https://developer.blender.org/rB1fb97ffeedc9aefa4351b34bdc51764817dd2140

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...

===================================================================

M	source/blender/blenkernel/intern/image.c

===================================================================

diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 4275b02..eeb2f83 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);




More information about the Bf-blender-cvs mailing list