Fix for bug #5044: random crashes when rendering.
This one is of my own making, removed too many locks. Thanks Malefico for reporting.
This commit is contained in:
@@ -784,8 +784,10 @@ static void animated_image(bNode *node, int cfra)
|
||||
if(imanr < 0) imanr = 0;
|
||||
if(imanr > (dur-1)) imanr= dur-1;
|
||||
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
if(ima->ibuf) IMB_freeImBuf(ima->ibuf);
|
||||
ima->ibuf = IMB_anim_absolute(ima->anim, imanr);
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
|
||||
/* patch for textbutton with name ima (B_NAMEIMA) */
|
||||
if(ima->ibuf) {
|
||||
@@ -836,7 +838,9 @@ static CompBuf *node_composit_get_image(bNode *node, RenderData *rd)
|
||||
if(ima->ok==0) return NULL;
|
||||
|
||||
if(ima->ibuf==NULL) {
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
load_image(ima, IB_rect, G.sce, rd->cfra); /* G.sce is current .blend path */
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
if(ima->ibuf==NULL) {
|
||||
ima->ok= 0;
|
||||
return NULL;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "BLI_arithb.h"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_threads.h"
|
||||
|
||||
#include "IMB_imbuf_types.h"
|
||||
#include "IMB_imbuf.h" /* for rectcpy */
|
||||
@@ -645,9 +646,11 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
|
||||
if(env->ima && env->ima->ok) {
|
||||
if(env->ima->ibuf==NULL) {
|
||||
printf("load ibuf\n");
|
||||
ima_ibuf_is_nul(tex, tex->ima);
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
if(ima->ibuf==NULL) ima_ibuf_is_nul(tex, tex->ima);
|
||||
if(env->ima->ok && env->ok==0)
|
||||
envmap_split_ima(env);
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "DNA_texture_types.h"
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_threads.h"
|
||||
|
||||
#include "BKE_utildefines.h"
|
||||
#include "BKE_global.h"
|
||||
@@ -104,8 +105,11 @@ int imagewrap(Tex *tex, Image *ima, float *texvec, TexResult *texres)
|
||||
/* hack for icon render */
|
||||
if(R.r.scemode &R_NO_IMAGE_LOAD)
|
||||
return 0;
|
||||
if(ima->ibuf==NULL)
|
||||
ima_ibuf_is_nul(tex, ima);
|
||||
if(ima->ibuf==NULL) {
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
if(ima->ibuf==NULL) ima_ibuf_is_nul(tex, ima);
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
}
|
||||
}
|
||||
|
||||
if (ima->ok) {
|
||||
@@ -626,15 +630,23 @@ int imagewraposa(Tex *tex, Image *ima, float *texvec, float *dxt, float *dyt, Te
|
||||
return retval;
|
||||
}
|
||||
|
||||
if(ima->ibuf==NULL)
|
||||
ima_ibuf_is_nul(tex, ima);
|
||||
if(ima->ibuf==NULL) {
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
if(ima->ibuf==NULL) ima_ibuf_is_nul(tex, ima);
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
}
|
||||
|
||||
if (ima->ok) {
|
||||
|
||||
if(tex->imaflag & TEX_MIPMAP)
|
||||
if(ima->mipmap[0]==NULL)
|
||||
if(ima->mipmap[0]==NULL)
|
||||
makemipmap(tex, ima);
|
||||
if(tex->imaflag & TEX_MIPMAP) {
|
||||
if(ima->mipmap[0]==NULL) {
|
||||
if(ima->mipmap[0]==NULL) {
|
||||
BLI_lock_thread(LOCK_CUSTOM1);
|
||||
if(ima->mipmap[0]==NULL) makemipmap(tex, ima);
|
||||
BLI_unlock_thread(LOCK_CUSTOM1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ibuf = ima->ibuf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user