Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: src/core/SkLazyPtr.h

Issue 304383005: Port most uses of SkOnce to SkLazyPtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: static Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkLazyPtr.h
diff --git a/src/core/SkLazyPtr.h b/src/core/SkLazyPtr.h
index 515086876c636bf99fdecacb6db15649ae0429ee..28bb895b76ceaa77e5e8b0e0989517a7b5a0a19e 100644
--- a/src/core/SkLazyPtr.h
+++ b/src/core/SkLazyPtr.h
@@ -62,7 +62,7 @@
#include "SkThread.h"
#include "SkThreadPriv.h"
-// See FIXME below.
+// See FIXMEs below.
class SkFontConfigInterface;
class SkTypeface;
@@ -100,7 +100,6 @@ public:
#ifdef SK_DEBUG
// FIXME: We know we leak refs on some classes. For now, let them leak.
void cleanup(SkFontConfigInterface*) {}
- void cleanup(SkTypeface*) {}
template <typename U> void cleanup(U* ptr) { Destroy(ptr); }
~SkLazyPtr() {
@@ -126,9 +125,12 @@ public:
}
#ifdef SK_DEBUG
+ // FIXME: We know we leak refs on some classes. For now, let them leak.
+ void cleanup(SkTypeface*) {}
+ template <typename U> void cleanup(U* ptr) { Destroy(ptr); }
~SkLazyPtrArray() {
for (int i = 0; i < N; i++) {
- Destroy((T*)fArray[i]);
+ this->cleanup((T*)fArray[i]);
fArray[i] = NULL;
}
}

Powered by Google App Engine
This is Rietveld 408576698