From 8b7e01b0bbdada3070c52f980a5f610d4a6c98c8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 29 Sep 2010 22:13:24 +0000 Subject: [PATCH] Fix #24018: moving backdrop in node editor not working anymore after thread safety fixes, was one case where it was still using get_ibuf instead of acquire/release_ibuf, this is required for render and compositing results which are modified by other threads. --- source/blender/editors/space_node/node_edit.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index b6dc0b4db7c..968391f271e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -750,12 +750,15 @@ static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event) Image *ima; ImBuf *ibuf; int pad= 10; + void *lock; ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); - ibuf= BKE_image_get_ibuf(ima, NULL); + ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock); - if(ibuf == NULL) + if(ibuf == NULL) { + BKE_image_release_ibuf(ima, lock); return OPERATOR_CANCELLED; + } nvm= MEM_callocN(sizeof(NodeViewMove), "NodeViewMove struct"); op->customdata= nvm; @@ -766,6 +769,8 @@ static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event) nvm->xmax = ar->winx/2 + ibuf->x/2 - pad; nvm->ymin = -(ar->winy/2) - ibuf->y/2 + pad; nvm->ymax = ar->winy/2 + ibuf->y/2 - pad; + + BKE_image_release_ibuf(ima, lock); /* add modal handler */ WM_event_add_modal_handler(C, op);