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

Unified Diff: src/pdf/SkPDFStream.cpp

Issue 395543002: Fix memory leak introduced in http://crrev.com/387863005 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/pdf/SkPDFStream.cpp
diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp
index 60fce0d6f129b86d4f0f74779fe99afceabef449..c310998a57b3f9b6dae39b4d93d2187a8c0300ff 100644
--- a/src/pdf/SkPDFStream.cpp
+++ b/src/pdf/SkPDFStream.cpp
@@ -114,7 +114,9 @@ bool SkPDFStream::populate(SkPDFCatalog* catalog) {
SkFlate::Deflate(fDataStream.get(), &compressedData));
SkAssertResult(fDataStream->rewind());
if (compressedData.getOffset() < this->dataSize()) {
- this->setData(compressedData.detachAsStream());
+ SkAutoTUnref<SkStream> compressed(
+ compressedData.detachAsStream());
+ this->setData(compressed.get());
insertName("Filter", "FlateDecode");
}
fState = kCompressed_State;
« 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