Index: include/core/SkWeakRefCnt.h |
diff --git a/include/core/SkWeakRefCnt.h b/include/core/SkWeakRefCnt.h |
index d9f0dc80d6722c9ad429aa15ed853be2fa28484e..210dcc9f1c7bd6bdbefd2a375fb6851ef2ffdd02 100644 |
--- a/include/core/SkWeakRefCnt.h |
+++ b/include/core/SkWeakRefCnt.h |
@@ -60,18 +60,20 @@ public: |
*/ |
SkWeakRefCnt() : SkRefCnt(), fWeakCnt(1) {} |
-#ifdef SK_DEBUG |
/** Destruct, asserting that the weak reference count is 1. |
*/ |
virtual ~SkWeakRefCnt() { |
+#ifdef SK_DEBUG |
SkASSERT(fWeakCnt == 1); |
fWeakCnt = 0; |
+#endif |
} |
/** Return the weak reference count. |
*/ |
int32_t getWeakCnt() const { return fWeakCnt; } |
+#ifdef SK_DEBUG |
void validate() const { |
this->INHERITED::validate(); |
SkASSERT(fWeakCnt > 0); |
@@ -153,9 +155,6 @@ private: |
/* Invariant: fWeakCnt = #weak + (fRefCnt > 0 ? 1 : 0) */ |
mutable int32_t fWeakCnt; |
- // Used by tests. |
- friend bool WeakRefCntIs(const SkWeakRefCnt&, int32_t); |
- |
typedef SkRefCnt INHERITED; |
}; |