~ruther/NosSmooth

197af02c063ffa7944c1a60a816bbf52277a0d4f — Rutherther 3 years ago d9cc716
fix(core): cancel control command cancellation token every time
M Core/NosSmooth.Core/Commands/Control/ControlCommands.cs => Core/NosSmooth.Core/Commands/Control/ControlCommands.cs +4 -1
@@ 198,7 198,10 @@ public class ControlCommands

        try
        {
            data.CancellationTokenSource.Cancel();
            if (!data.CancellationTokenSource.IsCancellationRequested)
            {
                data.CancellationTokenSource.Cancel();
            }
        }
        catch
        {

M Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs => Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs +14 -0
@@ 49,5 49,19 @@ public class TakeControlCommandHandler : ICommandHandler<TakeControlCommand>
        {
            return e;
        }
        finally
        {
            if (!source.IsCancellationRequested)
            {
                try
                {
                    source.Cancel();
                }
                catch (Exception e)
                {
                    // ignored
                }
            }
        }
    }
}
\ No newline at end of file

Do not follow this link