Clean up SkLazyPtrs only in SK_DEVELOPER mode.
authormtklein <mtklein@chromium.org>
Mon, 2 Jun 2014 14:53:01 +0000 (07:53 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 2 Jun 2014 14:53:01 +0000 (07:53 -0700)
Checking only SK_DEBUG may make SkLazyPtr too anal about leaks for
clients.  Still working through strange leak problems inside Skia
tests, so it's probably premature to turn it on in Chrome tests.

BUG=379570
R=reed@google.com, mtklein@google.com, bungeman@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/308003014

src/core/SkLazyPtr.h

index 5150868..71876e7 100644 (file)
@@ -97,7 +97,7 @@ public:
         return ptr ? ptr : try_cas<T*, Destroy>(&fPtr, Create());
     }
 
-#ifdef SK_DEBUG
+#ifdef SK_DEVELOPER
     // FIXME: We know we leak refs on some classes.  For now, let them leak.
     void cleanup(SkFontConfigInterface*) {}
     void cleanup(SkTypeface*) {}
@@ -125,7 +125,7 @@ public:
         return ptr ? ptr : try_cas<T*, Destroy>(&fArray[i], Create(i));
     }
 
-#ifdef SK_DEBUG
+#ifdef SK_DEVELOPER
     ~SkLazyPtrArray() {
         for (int i = 0; i < N; i++) {
             Destroy((T*)fArray[i]);