daemon: Fix started service leak
This commit is contained in:
@@ -207,6 +207,14 @@ func (s *StartedService) StartOrReloadService(profileContent string, options *Ov
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *StartedService) Close() {
|
||||||
|
s.serviceStatusSubscriber.Close()
|
||||||
|
s.logSubscriber.Close()
|
||||||
|
s.urlTestSubscriber.Close()
|
||||||
|
s.clashModeSubscriber.Close()
|
||||||
|
s.connectionEventSubscriber.Close()
|
||||||
|
}
|
||||||
|
|
||||||
func (s *StartedService) CloseService() error {
|
func (s *StartedService) CloseService() error {
|
||||||
s.serviceAccess.Lock()
|
s.serviceAccess.Lock()
|
||||||
switch s.serviceStatus.Status {
|
switch s.serviceStatus.Status {
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ func (s *CommandServer) Close() {
|
|||||||
s.grpcServer.Stop()
|
s.grpcServer.Stop()
|
||||||
}
|
}
|
||||||
common.Close(s.listener)
|
common.Close(s.listener)
|
||||||
|
s.StartedService.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
type OverrideOptions struct {
|
type OverrideOptions struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user