From 772d8524cef44f973abde368a69f8d17b55c6d74 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Thu, 12 Dec 2013 16:27:12 +0000 Subject: ensure that we call onUnlock only when we onLock succeeded BUG= R=halcanary@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/112783004 git-svn-id: http://skia.googlecode.com/svn/trunk@12642 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkPixelRef.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index ec4937bea0..d4c35323bb 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -244,10 +244,15 @@ protected: acquire a mutex for thread safety, so this method need not do that. */ virtual void* onLockPixels(SkColorTable**) = 0; - /** Called when the lock count goes from 1 to 0. The caller will have - already acquire a mutex for thread safety, so this method need not do - that. - */ + + /** + * Called when the lock count goes from 1 to 0. The caller will have + * already acquire a mutex for thread safety, so this method need not do + * that. + * + * If the previous call to onLockPixels failed (i.e. returned NULL), then + * the onUnlockPixels will NOT be called. + */ virtual void onUnlockPixels() = 0; /** Default impl returns true */ -- cgit v1.2.3