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

Unified Diff: src/pdf/SkPDFResourceDict.cpp

Issue 20655004: Fix memory leak in SkPDFResourceDict (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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/SkPDFResourceDict.cpp
diff --git a/src/pdf/SkPDFResourceDict.cpp b/src/pdf/SkPDFResourceDict.cpp
index ee44f4ed5c02373fec36d97eab630422f044e6af..0102b3c49a28160722afb1c8c4786b30af9e17a6 100644
--- a/src/pdf/SkPDFResourceDict.cpp
+++ b/src/pdf/SkPDFResourceDict.cpp
@@ -112,14 +112,15 @@ SkPDFObject* SkPDFResourceDict::insertResource(
SkPDFDict* typeDict = fTypes[type];
if (NULL == typeDict) {
SkAutoTUnref<SkPDFDict> newDict(SkNEW(SkPDFDict()));
- SkPDFName* typeName = SkNEW_ARGS(
- SkPDFName, (get_resource_type_name(type)));
+ SkAutoTUnref<SkPDFName> typeName(
+ SkNEW_ARGS(SkPDFName, (get_resource_type_name(type))));
insert(typeName, newDict); // ref counting handled here
fTypes[type] = newDict;
typeDict = newDict.get();
}
- SkPDFName* keyName = SkNEW_ARGS(SkPDFName, (getResourceName(type, key)));
+ SkAutoTUnref<SkPDFName> keyName(
+ SkNEW_ARGS(SkPDFName, (getResourceName(type, key))));
typeDict->insert(keyName, value);
return value;
}
« 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