diff options
Diffstat (limited to 'src/slskd')
| -rw-r--r-- | src/slskd/Relay/RelayService.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/slskd/Relay/RelayService.cs b/src/slskd/Relay/RelayService.cs index 3ad36ed6..c063ceb2 100644 --- a/src/slskd/Relay/RelayService.cs +++ b/src/slskd/Relay/RelayService.cs @@ -858,6 +858,8 @@ namespace slskd.Relay else { // the controller changed. disconnect and throw away the client and create a new one + var oldClient = Client; + Client = new RelayClient( shareService: Shares, fileService: Files, @@ -867,6 +869,8 @@ namespace slskd.Relay Client.StateMonitor.OnChange(clientState => State.SetValue(state => state with { Controller = state.Controller with { State = clientState.Current } })); + oldClient.TryDispose(); + State.SetValue(state => state with { Mode = mode, |
