Index: src/core/SkPixelRef.cpp |
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp |
index 3191b0333b84deed555c3b12365c9c38255649c0..e7f5c8d94720f8870109d7923bf9056b968f1545 100644 |
--- a/src/core/SkPixelRef.cpp |
+++ b/src/core/SkPixelRef.cpp |
@@ -10,6 +10,7 @@ |
#include "SkThread.h" |
#include "SkTraceEvent.h" |
+//#define SK_SUPPORT_LEGACY_UNBALANCED_PIXELREF_LOCKCOUNT |
//#define SK_TRACE_PIXELREF_LIFETIME |
#ifdef SK_BUILD_FOR_WIN32 |
@@ -130,6 +131,10 @@ SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex) |
} |
SkPixelRef::~SkPixelRef() { |
+#ifndef SK_SUPPORT_LEGACY_UNBALANCED_PIXELREF_LOCKCOUNT |
+ SkASSERT(SKPIXELREF_PRELOCKED_LOCKCOUNT == fLockCount || 0 == fLockCount); |
+#endif |
+ |
#ifdef SK_TRACE_PIXELREF_LIFETIME |
SkDebugf("~pixelref %d\n", sk_atomic_dec(&gInstCounter) - 1); |
#endif |