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

Unified Diff: tools/VisualBench/VisualBench.cpp

Issue 1239103002: Fix visual bench memory leak (Closed) Base URL: https://skia.googlesource.com/skia.git@fixvb1
Patch Set: tweaks Created 5 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 | « tools/VisualBench/VisualBench.h ('k') | tools/VisualBench/VisualBenchmarkStream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualBench.cpp
diff --git a/tools/VisualBench/VisualBench.cpp b/tools/VisualBench/VisualBench.cpp
index e97db8a308901b0223e948c9a9f29a03738aaaf7..d8713e743cc4b4fdfa29320697e51c7a5a332b3b 100644
--- a/tools/VisualBench/VisualBench.cpp
+++ b/tools/VisualBench/VisualBench.cpp
@@ -163,10 +163,7 @@ bool VisualBench::advanceRecordIfNecessary(SkCanvas* canvas) {
return true;
}
- while ((fBenchmark = fBenchmarkStream->next()) &&
- (SkCommandLineFlags::ShouldSkip(FLAGS_match, fBenchmark->getUniqueName()) ||
- !fBenchmark->isSuitableFor(Benchmark::kGPU_Backend))) {}
-
+ fBenchmark.reset(fBenchmarkStream->next());
if (!fBenchmark) {
return false;
}
@@ -238,7 +235,7 @@ void VisualBench::draw(SkCanvas* canvas) {
fState = kPreWarmLoops_State;
this->printStats();
fBenchmark->perCanvasPostDraw(canvas);
- fBenchmark = NULL;
+ fBenchmark.reset(NULL);
fCurrentSample = 0;
fFlushes = 1;
fLoops = 1;
« no previous file with comments | « tools/VisualBench/VisualBench.h ('k') | tools/VisualBench/VisualBenchmarkStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698