[Bf-blender-cvs] [d631252] master: Fix lock release deadlock when acquiring pass with no data ready yet

Sergey Sharybin noreply at git.blender.org
Sun Jan 24 21:29:28 CET 2016


Commit: d631252109bea2e69dae67686b1b8611b52a670d
Author: Sergey Sharybin
Date:   Mon Jan 25 01:25:52 2016 +0500
Branches: master
https://developer.blender.org/rBd631252109bea2e69dae67686b1b8611b52a670d

Fix lock release deadlock when acquiring pass with no data ready yet

There is no reason to do separate image buffer release when there's
found buffer but with empty rects because of the following reasons:

- All the acquire() calls are followed with corresponding release()
  calls, regardless of whether image buffer was empty, missing or
  whatever.

- It was done wrong -- since lock was passed as NULL, it'll only
  de-reference the image buffer itself, this causes following:

  * Wrong user counter since there'll subsequent release() call with
    the proper lock passed to it.
  * Global locks are to be released prior to the spin locks,
    and such an extra release violated this rule.

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

M	source/blender/editors/space_image/image_edit.c

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

diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 3583485..e48f4e2 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -119,8 +119,6 @@ ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock)
 		if (ibuf) {
 			if (ibuf->rect || ibuf->rect_float)
 				return ibuf;
-
-			BKE_image_release_ibuf(sima->image, ibuf, NULL);
 		}
 	}
 	else




More information about the Bf-blender-cvs mailing list