Index: src/ports/SkFontHost_fontconfig.cpp |
=================================================================== |
--- src/ports/SkFontHost_fontconfig.cpp (revision 9450) |
+++ src/ports/SkFontHost_fontconfig.cpp (working copy) |
@@ -154,7 +154,9 @@ |
SkAutoTMalloc<uint8_t> allocMemory(length); |
stream->rewind(); |
if (length == stream->read(allocMemory.get(), length)) { |
- return new SkMemoryStream(allocMemory.detach(), length); |
+ SkAutoTUnref<SkMemoryStream> copyStream(new SkMemoryStream()); |
+ copyStream->setMemoryOwned(allocMemory.detach(), length); |
+ return copyStream.detach(); |
} |
stream->rewind(); |