freeing node trees no longer decreases their user counts, this cause causing invalid memory access when freeing the blend file.

This commit is contained in:
Campbell Barton
2012-10-02 13:59:05 +00:00
parent 75fff05348
commit 62c151bd1c
2 changed files with 12 additions and 4 deletions

View File

@@ -1047,7 +1047,15 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const short do_id_user)
/* same as ntreeFreeTree_ex but always manage users */
void ntreeFreeTree(bNodeTree *ntree)
{
/* XXX, this is correct, however when freeing the entire database
* this ends up accessing freed data which isn't properly unlinking
* its self from scene nodes, SO - for now prefer invalid usercounts
* on free rather then bad memory access - Campbell */
#if 0
ntreeFreeTree_ex(ntree, TRUE);
#else
ntreeFreeTree_ex(ntree, FALSE);
#endif
}
void ntreeFreeCache(bNodeTree *ntree)

View File

@@ -79,10 +79,10 @@ void ZCombineAlphaOperation::executePixel(float output[4], float x, float y, Pix
}
float fac = color1[3];
float ifac = 1.0f - fac;
output[0] = fac*color1[0] + ifac * color2[0];
output[1] = fac*color1[1] + ifac * color2[1];
output[2] = fac*color1[2] + ifac * color2[2];
output[3] = MAX2(color1[3], color2[3]);
output[0] = fac * color1[0] + ifac * color2[0];
output[1] = fac * color1[1] + ifac * color2[1];
output[2] = fac * color1[2] + ifac * color2[2];
output[3] = max(color1[3], color2[3]);
}
void ZCombineOperation::deinitExecution()