cancelling bake wasn't freeing the bake mask.

This commit is contained in:
Campbell Barton
2011-04-22 16:47:17 +00:00
parent e520c498d2
commit 1518d43f27

View File

@@ -189,9 +189,18 @@ static void finish_bake_internal(BakeRender *bkr)
for(ima= G.main->image.first; ima; ima= ima->id.next) {
if(ima->ok==IMA_OK_LOADED) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
GPU_free_image(ima);
imb_freemipmapImBuf(ibuf);
if(ibuf) {
if(ibuf->userflags & IB_BITMAPDIRTY) {
GPU_free_image(ima);
imb_freemipmapImBuf(ibuf);
}
/* freed when baking is done, but if its canceled we need to free here */
if (ibuf->userdata) {
printf("freed\n");
MEM_freeN(ibuf->userdata);
ibuf->userdata= NULL;
}
}
}
}