From 807ad1f0e0de49711d58ade2b660e74ec5452b2b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 13 Jul 2012 13:47:13 +0000 Subject: Fix #32087: Crash while changing values in comp editor (bt and blender included) Issue was caused by threading conflict between compositor output node which is freeing buffers used by render result image and image draw code which could use buffers at the same time as compositor frees this buffers. Solved by adding adding lock around viewer image invalidation and image drawing. Use renamed LOCK_PREVIEW mutex for this, which si not called LOCK_DRAW_IMAGE. With new compositor locking for preview is not needed so it could be removed. Added the same lock around viewer operation which also frees buffers used by viewer image. It's actually quite difficult to check whether this is indeed needed. This code seems to be using acquire/release technique, but somehow acquiring ImBuf before invalidating it in compositor operation doesn't resolve the issue, so probably it's not actually locking acquire and things should be checked deeper. --- source/blender/blenlib/BLI_threads.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib/BLI_threads.h') diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 3b75797a3a9..902373bcd6b 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -70,7 +70,7 @@ int BLI_system_thread_count(void); /* gets the number of threads the system * One custom lock available now. can be extended. */ #define LOCK_IMAGE 0 -#define LOCK_PREVIEW 1 +#define LOCK_DRAW_IMAGE 1 #define LOCK_VIEWER 2 #define LOCK_CUSTOM1 3 #define LOCK_RCACHE 4 -- cgit v1.2.3