diff --git a/daemon/started_service.go b/daemon/started_service.go index a42a752d..7c6fa945 100644 --- a/daemon/started_service.go +++ b/daemon/started_service.go @@ -207,6 +207,14 @@ func (s *StartedService) StartOrReloadService(profileContent string, options *Ov 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 { s.serviceAccess.Lock() switch s.serviceStatus.Status { diff --git a/experimental/libbox/command_server.go b/experimental/libbox/command_server.go index 2b4ac71b..e3300281 100644 --- a/experimental/libbox/command_server.go +++ b/experimental/libbox/command_server.go @@ -159,6 +159,7 @@ func (s *CommandServer) Close() { s.grpcServer.Stop() } common.Close(s.listener) + s.StartedService.Close() } type OverrideOptions struct {