Index: src/fonts/SkFontMgr_fontconfig.cpp |
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp |
index a3989fca75cdfc39c260c75f4ddf5d981f10feb3..c1d531d3f5348cd7a621de9ec1919cdb41010945 100644 |
--- a/src/fonts/SkFontMgr_fontconfig.cpp |
+++ b/src/fonts/SkFontMgr_fontconfig.cpp |
@@ -296,6 +296,7 @@ protected: |
SkTypeface* onCreateFromData(SkData*, int ttcIndex) const SK_OVERRIDE { return NULL; } |
SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE { |
+ SkAutoTDelete<SkStream> streamDeleter(stream); |
const size_t length = stream->getLength(); |
if (!length) { |
return NULL; |
@@ -311,13 +312,13 @@ protected: |
return NULL; |
} |
- SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, stream); |
+ SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, streamDeleter.detach()); |
return face; |
} |
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERRIDE { |
- SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); |
- return stream.get() ? this->createFromStream(stream, ttcIndex) : NULL; |
+ SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); |
+ return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL; |
} |
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |