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

Unified Diff: tools/filtermain.cpp

Issue 15029008: Fix memory leak in filter tool (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: tools/filtermain.cpp
===================================================================
--- tools/filtermain.cpp (revision 9089)
+++ tools/filtermain.cpp (working copy)
@@ -626,14 +626,14 @@
static int filter_picture(const SkString& inFile, const SkString& outFile) {
- SkPicture* inPicture = NULL;
+ SkAutoTDelete<SkPicture> inPicture;
bungeman-skia 2013/05/10 17:30:36 SkPicture is SkRefCnt, it seems odd to SkAutoTDele
SkFILEStream inStream(inFile.c_str());
if (inStream.isValid()) {
- inPicture = SkNEW_ARGS(SkPicture, (&inStream, NULL, &SkImageDecoder::DecodeMemory));
+ inPicture.reset(SkNEW_ARGS(SkPicture, (&inStream, NULL, &SkImageDecoder::DecodeMemory)));
}
- if (NULL == inPicture) {
+ if (NULL == inPicture.get()) {
SkDebugf("Could not read file %s\n", inFile.c_str());
return -1;
}
@@ -715,6 +715,10 @@
int tool_main(int argc, char** argv); // suppress a warning on mac
int tool_main(int argc, char** argv) {
+#if SK_ENABLE_INST_COUNT
+ gPrintInstCount = true;
+#endif
+
jvanverth1 2013/05/10 14:34:46 Did you mean to leave this in there?
robertphillips 2013/05/10 14:36:18 Yep - when enabled it prints out leak info
SkGraphics::Init();
if (argc < 3) {
« 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