aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLazyPtr.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-30 21:00:52 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-30 21:00:52 +0000
commitf6351a071810b3a848a5002a0c0ba7e1490fd0db (patch)
tree07dcff256e7ba4b7a1a7b2cb5b6fdca8c42938c5 /src/core/SkLazyPtr.h
parent97f5fc651956287e78e35934cf62b9e1b45b4f6c (diff)
Revert of Port most uses of SkOnce to SkLazyPtr. (https://codereview.chromium.org/304383005/)
Reason for revert: Leaking refs on SkTypeface on Macs. Original issue's description: > Port most uses of SkOnce to SkLazyPtr. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=15006 R=reed@google.com, mtklein@chromium.org TBR=mtklein@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/304283007 git-svn-id: http://skia.googlecode.com/svn/trunk@15009 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkLazyPtr.h')
-rw-r--r--src/core/SkLazyPtr.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/SkLazyPtr.h b/src/core/SkLazyPtr.h
index 28bb895b76..515086876c 100644
--- a/src/core/SkLazyPtr.h
+++ b/src/core/SkLazyPtr.h
@@ -62,7 +62,7 @@
#include "SkThread.h"
#include "SkThreadPriv.h"
-// See FIXMEs below.
+// See FIXME below.
class SkFontConfigInterface;
class SkTypeface;
@@ -100,6 +100,7 @@ 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() {
@@ -125,12 +126,9 @@ 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++) {
- this->cleanup((T*)fArray[i]);
+ Destroy((T*)fArray[i]);
fArray[i] = NULL;
}
}