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

Unified Diff: src/core/SkTypeface.cpp

Issue 14617019: Fix memory leak in SkTypeface.cpp (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
===================================================================
--- src/core/SkTypeface.cpp (revision 9092)
+++ src/core/SkTypeface.cpp (working copy)
@@ -116,8 +116,9 @@
if (length > 0) {
void* addr = sk_malloc_flags(length, 0);
if (addr) {
- SkAutoTUnref<SkStream> localStream(SkNEW_ARGS(SkMemoryStream,
- (addr, length, false)));
+ SkAutoTUnref<SkMemoryStream> localStream(SkNEW(SkMemoryStream));
reed1 2013/05/10 16:58:09 Grrr, we should look for a clean way to say this i
+ localStream->setMemoryOwned(addr, length);
+
if (stream->read(addr, length) == length) {
return SkTypeface::CreateFromStream(localStream.get());
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698