Fix missing render result release when alt-wheeling render pass menu
This commit is contained in:
@@ -597,6 +597,7 @@ static bool ui_imageuser_pass_menu_step(bContext *C, int direction, void *rnd_pt
|
|||||||
|
|
||||||
rr = BKE_image_acquire_renderresult(scene, image);
|
rr = BKE_image_acquire_renderresult(scene, image);
|
||||||
if (UNLIKELY(rr == NULL)) {
|
if (UNLIKELY(rr == NULL)) {
|
||||||
|
BKE_image_release_renderresult(scene, image);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -606,11 +607,13 @@ static bool ui_imageuser_pass_menu_step(bContext *C, int direction, void *rnd_pt
|
|||||||
|
|
||||||
rl = BLI_findlink(&rr->layers, layer);
|
rl = BLI_findlink(&rr->layers, layer);
|
||||||
if (rl == NULL) {
|
if (rl == NULL) {
|
||||||
|
BKE_image_release_renderresult(scene, image);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpass = BLI_findlink(&rl->passes, iuser->pass);
|
rpass = BLI_findlink(&rl->passes, iuser->pass);
|
||||||
if (rpass == NULL) {
|
if (rpass == NULL) {
|
||||||
|
BKE_image_release_renderresult(scene, image);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -631,8 +634,10 @@ static bool ui_imageuser_pass_menu_step(bContext *C, int direction, void *rnd_pt
|
|||||||
RenderPass *rp;
|
RenderPass *rp;
|
||||||
int rp_index = 0;
|
int rp_index = 0;
|
||||||
|
|
||||||
if (iuser->pass == 0)
|
if (iuser->pass == 0) {
|
||||||
|
BKE_image_release_renderresult(scene, image);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (rp = rl->passes.first; rp; rp = rp->next, rp_index++) {
|
for (rp = rl->passes.first; rp; rp = rp->next, rp_index++) {
|
||||||
if (rp->passtype == rpass->passtype) {
|
if (rp->passtype == rpass->passtype) {
|
||||||
@@ -646,6 +651,8 @@ static bool ui_imageuser_pass_menu_step(bContext *C, int direction, void *rnd_pt
|
|||||||
BLI_assert(0);
|
BLI_assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BKE_image_release_renderresult(scene, image);
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
BKE_image_multilayer_index(rr, iuser);
|
BKE_image_multilayer_index(rr, iuser);
|
||||||
WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
|
WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
|
||||||
|
Reference in New Issue
Block a user