fix circular cancel at rcDiscoverCtrl (#3438)

This commit is contained in:
Alexander Bondarenko
2023-11-23 13:00:57 +02:00
committed by GitHub
parent d3f9616f9b
commit d837f87f09

View File

@@ -659,7 +659,8 @@ cancelActiveRemoteCtrl sseq_ = handleAny (logError . tshow) $ do
cancelRemoteCtrl :: Bool -> RemoteCtrlSession -> IO ()
cancelRemoteCtrl handlingError = \case
RCSessionStarting -> pure ()
RCSessionSearching {action} -> uninterruptibleCancel action
RCSessionSearching {action} ->
unless handlingError $ uninterruptibleCancel action
RCSessionConnecting {rcsClient, rcsWaitSession} -> do
unless handlingError $ uninterruptibleCancel rcsWaitSession
cancelCtrlClient rcsClient