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

Unified Diff: src/ports/SkFontHost_fontconfig.cpp

Issue 16525003: Fix leak in SkFontHost_fontconfig temporary code. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: My fingers forgot to type 'detatch'. Created 7 years, 6 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/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();
« 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