[Bf-blender-cvs] [45fd68b] blender-v2.75-release: Fix T44871: Blender hangs when using masking, dilate-erode and soften node

Sergey Sharybin noreply at git.blender.org
Thu Jun 18 17:36:35 CEST 2015


Commit: 45fd68bc98e0146c01dd075ebc15502c02033153
Author: Sergey Sharybin
Date:   Wed Jun 10 21:32:12 2015 +0200
Branches: blender-v2.75-release
https://developer.blender.org/rB45fd68bc98e0146c01dd075ebc15502c02033153

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.

===================================================================

M	source/blender/compositor/operations/COM_ViewerOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index 96ee5ec..aa47d34 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)




More information about the Bf-blender-cvs mailing list