mirror of
https://github.com/fatedier/frp.git
synced 2025-04-23 16:21:25 +00:00
Fix goroutine leaks
This commit is contained in:
parent
881f21431d
commit
751c789cca
@ -19,8 +19,6 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/fatedier/golib/errors"
|
|
||||||
|
|
||||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||||
"github.com/fatedier/frp/pkg/msg"
|
"github.com/fatedier/frp/pkg/msg"
|
||||||
)
|
)
|
||||||
@ -90,11 +88,9 @@ func (pxy *XTCPProxy) Run() (remoteAddr string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pxy *XTCPProxy) Close() {
|
func (pxy *XTCPProxy) Close() {
|
||||||
pxy.BaseProxy.Close()
|
|
||||||
pxy.rc.NatHoleController.CloseClient(pxy.GetName())
|
|
||||||
pxy.closeOnce.Do(func() {
|
pxy.closeOnce.Do(func() {
|
||||||
_ = errors.PanicToError(func() {
|
pxy.BaseProxy.Close()
|
||||||
close(pxy.closeCh)
|
pxy.rc.NatHoleController.CloseClient(pxy.GetName())
|
||||||
})
|
close(pxy.closeCh)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user