Skip to content

Commit

Permalink
修复udp协程泄露
Browse files Browse the repository at this point in the history
v.conn.link.Reader这个是pipe.Reader,并没有Close方法,所以断言失败,导致pipe没有关闭然后泄露。修改为Interrupt即可解决
  • Loading branch information
isluckys authored and yuhan6665 committed May 30, 2024
1 parent 73c5650 commit 3d67402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport/internet/udp/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (v *Dispatcher) RemoveRay() {
v.Lock()
defer v.Unlock()
if v.conn != nil {
common.Close(v.conn.link.Reader)
common.Interrupt(v.conn.link.Reader)
common.Close(v.conn.link.Writer)
v.conn = nil
}
Expand Down

0 comments on commit 3d67402

Please sign in to comment.