From 81f4b0d1e0f5d1244dc5018f59542070bd309b97 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 12 Oct 2016 11:04:25 -0400 Subject: [PATCH] Remove hack allowing fRefCnt of 0. In some legacy situations users of SkRefCnt subclasses were keeping the objects alive with a reference count of 0. Now that these users are cleaned up, remove the hack which allowed such code to keep functioning. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3264 Change-Id: I22f63d87b6d995cad6326998284930ad9eaa2983 Reviewed-on: https://skia-review.googlesource.com/3264 Reviewed-by: Derek Sollenberger Reviewed-by: Mike Reed Commit-Queue: Ben Wagner --- include/core/SkRefCnt.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 82a3c9e..a502d4e 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -71,15 +71,7 @@ public: /** Increment the reference count. Must be balanced by a call to unref(). */ void ref() const { -#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK - // Android employs some special subclasses that enable the fRefCnt to - // go to zero, but not below, prior to reusing the object. This breaks - // the use of unique() on such objects and as such should be removed - // once the Android code is fixed. - SkASSERT(getRefCnt() >= 0); -#else SkASSERT(getRefCnt() > 0); -#endif // No barrier required. (void)fRefCnt.fetch_add(+1, std::memory_order_relaxed); } -- 2.7.4