Skip to content

Commit 604453a

Browse files
lmbti-mo
authored andcommitted
perf: drop finalizer on Reader
It's not possible to call Reader.Close from a Cleanup, which indicates that it's probably not the right thing to do here. Drop the finalizer. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent 1d13991 commit 604453a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

perf/reader.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"fmt"
99
"io"
1010
"os"
11-
"runtime"
1211
"sync"
1312
"time"
1413

@@ -261,7 +260,6 @@ func NewReaderWithOptions(array *ebpf.Map, perCPUBuffer int, opts ReaderOptions)
261260
if err = pr.Resume(); err != nil {
262261
return nil, err
263262
}
264-
runtime.SetFinalizer(pr, (*Reader).Close)
265263
return pr, nil
266264
}
267265

0 commit comments

Comments
 (0)