diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-10 22:32:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-11 15:53:15 +0300 |
commit | bb5e46f10506f6fcfdf5777af3f0039bab49ed3c (patch) | |
tree | f62be44526002c7f67de28b1632d57e089a4ac5d /source/blender/compositor/operations/COM_ViewerOperation.cpp | |
parent | 41564a402ebc317304b8f063d7729d12bad76978 (diff) |
Fix T44871: Blender hangs when using masking, dilate-erode and soften node
The issue was caused by wrong order of locks acquisition in the compositor image node.
Diffstat (limited to 'source/blender/compositor/operations/COM_ViewerOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ViewerOperation.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp index 96ee5ecbb03..aa47d3427d0 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp @@ -135,12 +135,16 @@ void ViewerOperation::initImage() BKE_image_verify_viewer_views(this->m_rd, ima, this->m_imageUser); } + BLI_lock_thread(LOCK_DRAW_IMAGE); + /* local changes to the original ImageUser */ iuser.multi_index = BKE_scene_multiview_view_id_get(this->m_rd, this->m_viewName); ibuf = BKE_image_acquire_ibuf(ima, &iuser, &lock); - if (!ibuf) return; - BLI_lock_thread(LOCK_DRAW_IMAGE); + if (!ibuf) { + BLI_unlock_thread(LOCK_DRAW_IMAGE); + return; + } if (ibuf->x != (int)getWidth() || ibuf->y != (int)getHeight()) { imb_freerectImBuf(ibuf); @@ -159,7 +163,6 @@ void ViewerOperation::initImage() if (m_doDepthBuffer) { addzbuffloatImBuf(ibuf); } - BLI_unlock_thread(LOCK_DRAW_IMAGE); /* now we combine the input with ibuf */ this->m_outputBuffer = ibuf->rect_float; @@ -172,6 +175,8 @@ void ViewerOperation::initImage() } BKE_image_release_ibuf(this->m_image, this->m_ibuf, lock); + + BLI_unlock_thread(LOCK_DRAW_IMAGE); } void ViewerOperation::updateImage(rcti *rect) |