Skip to content

Commit 003d434

Browse files
committed
close the leader last
1 parent ffe9501 commit 003d434

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/LinuxPerf.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ reset!(g::EventGroup) = ioctl(g, PERF_EVENT_IOC_RESET)
288288

289289
function Base.close(g::EventGroup)
290290
for fd in g.fds
291+
fd == g.leader_fd && continue # close leader_fd last
291292
ccall(:close, Cint, (Cint,), fd)
292293
end
294+
ccall(:close, Cint, (Cint,), g.leader_fd)
293295
end
294296

295297
mutable struct PerfBench

0 commit comments

Comments
 (0)