Skip to content

Commit c8d7ec9

Browse files
authored
fix(session): fix panic: close of closed channel (#97)
1 parent 7be6ef6 commit c8d7ec9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

api_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package pyroscope
2+
3+
import (
4+
"testing"
5+
)
6+
7+
func TestProfilerStartStop(t *testing.T) {
8+
profiler, err := Start(Config{
9+
ApplicationName: "test",
10+
})
11+
if err != nil {
12+
t.Fatal(err)
13+
}
14+
profiler.Stop()
15+
}

session.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (ps *Session) takeSnapshots() {
163163
if ps.isCPUEnabled() {
164164
ps.cpu.Stop()
165165
}
166+
return
166167
}
167168
}
168169
}

0 commit comments

Comments
 (0)