Skip to content

Commit 7db58e9

Browse files
committed
close the leader last
1 parent ab48d7f commit 7db58e9

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
@@ -290,8 +290,10 @@ reset!(g::EventGroup) = ioctl(g, PERF_EVENT_IOC_RESET)
290290

291291
function Base.close(g::EventGroup)
292292
for fd in g.fds
293+
fd == g.leader_fd && continue # close leader_fd last
293294
ccall(:close, Cint, (Cint,), fd)
294295
end
296+
ccall(:close, Cint, (Cint,), g.leader_fd)
295297
end
296298

297299
mutable struct PerfBench

0 commit comments

Comments
 (0)