diff options
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 4 | ||||
-rw-r--r-- | source/blender/editors/preview/previewrender.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 884724270ae..2812f17d58f 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -112,12 +112,12 @@ typedef struct ThreadSlot { int avail; } ThreadSlot; -static void BLI_lock_malloc_thread(void) +void BLI_lock_malloc_thread(void) { pthread_mutex_lock(&_malloc_lock); } -static void BLI_unlock_malloc_thread(void) +void BLI_unlock_malloc_thread(void) { pthread_mutex_unlock(&_malloc_lock); } diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index a17c488f1c9..096282a0f58 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -44,6 +44,7 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" +#include "BLI_threads.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" @@ -634,6 +635,7 @@ void ED_preview_draw(const bContext *C, void *idp, rcti *rect) char name[32]; sprintf(name, "Preview %p", sa); + BLI_lock_malloc_thread(); RE_GetResultImage(RE_GetRender(name), &rres); if(rres.rectf) { @@ -648,7 +650,8 @@ void ED_preview_draw(const bContext *C, void *idp, rcti *rect) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } } - + BLI_unlock_malloc_thread(); + /* check for spacetype... */ if(sbuts->spacetype==SPACE_BUTS && sbuts->preview) { sbuts->preview= 0; |