diff options
author | 2014-05-30 20:42:00 +0000 | |
---|---|---|
committer | 2014-05-30 20:42:00 +0000 | |
commit | 5a70945ddd036b8079987954123ff8f382c285af (patch) | |
tree | 3bb2d0ee55d6732edc13c04d4f63050deea157e3 /src/core/SkLazyPtr.h | |
parent | 2a5cd60bfff32c92cf44a8cfc3e8c017b9aee456 (diff) |
Port most uses of SkOnce to SkLazyPtr.
BUG=skia:
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/304383005
git-svn-id: http://skia.googlecode.com/svn/trunk@15006 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkLazyPtr.h')
-rw-r--r-- | src/core/SkLazyPtr.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/SkLazyPtr.h b/src/core/SkLazyPtr.h index 515086876c..28bb895b76 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; } } |