Skip to content

Commit cf98580

Browse files
committed
Close LinuxPerf bench when done with it
1 parent 4fa2d8e commit cf98580

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/parameters.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ function perf_available()
2424
return false
2525
end
2626

27+
bench = nothing
2728
try
2829
opts = LinuxPerf.parse_pstats_options([])
2930
groups = BenchmarkTools.LinuxPerf.set_default_spaces(opts.events, opts.spaces)
3031
bench = make_bench_threaded(groups; threads=opts.threads)
3132
return true
3233
catch
3334
return false
35+
finally
36+
if !isnothing(bench)
37+
close(bench)
38+
end
3439
end
3540
end
3641

0 commit comments

Comments
 (0)