diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 4db545757..a3e1fd0f8 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -2460,11 +2460,6 @@ class Benchmark { } shared.mu.Unlock(); - for (int i = 0; i < n; i++) { - delete arg[i].thread; - } - delete[] arg; - // Stats for some threads can be excluded. Stats merge_stats; for (int i = 0; i < n; i++) { @@ -2472,6 +2467,11 @@ class Benchmark { } merge_stats.Report(name); + for (int i = 0; i < n; i++) { + delete arg[i].thread; + } + delete[] arg; + return merge_stats; }