Skip to content

Low: Task.Delay(Timeout.Infinite) task is never cancelled — minor resource leak #175

Description

@negativeeddy

Task.Delay(Timeout.Infinite) task is never cancelled — minor resource leak

Source: Code review (automated)
Date: 2026-09-02
Scope: Recent changes (Manual Selection rip mode, PR #144)
File(s): src/ArmRipper.Core/Rip/ArmRipperService.cs

Problem

When the TCS completes (user clicks Continue), Task.WhenAny returns but the Task.Delay(Timeout.Infinite, linkedCts.Token) task is never awaited or cancelled. Disposing linkedCts does not cancel the token, so the delay task remains pending for the process lifetime. Each manual selection leaves one orphaned pending task.

Proposed Fix

Cancel the delay explicitly (e.g. linkedCts.Cancel() in the finally, or use a CancellationTokenSource that is cancelled after WhenAny).

Notes

Minor resource leak; low impact but easy to fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions