diff options
author | Ton Roosendaal <ton@blender.org> | 2009-06-07 16:12:55 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-06-07 16:12:55 +0400 |
commit | fd1f1c5736aad7065076f70f630284d7ded836c9 (patch) | |
tree | 615559abb57919a70c3edccc0542803fbfd09670 /source | |
parent | 349f5df595140d9827862ba7024f6fe6d49a7a22 (diff) |
2.5
Quick test commit to check on crashing previews; ignore warning about
implicit declaration... here in OSX i can't get this crash!
Diffstat (limited to 'source')
-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; |