Skip to content

Out of memory exception when using cancellation token #717

@lee-baker

Description

@lee-baker

Hi,

We have recently added cancellation tokens to our restsharp requests and have been leaking memory since. The stackoverflow question below suggests that the token.Register() call returns a CancellationTokenRegistration that should be disposed when the task is completed.

https://stackoverflow.com/questions/14627226/why-is-my-async-await-with-cancellationtokensource-leaking-memory

Is there any reason this process is not followed in the RestClient.Async class ExecuteTaskAsync method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions