Skip to content

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented May 16, 2023

Capturing ExecutionContext can cause a memory leak of async locals values.

restoreFlow = true;
}

_ = Task.Run(ConnectTransportAsync);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be to put an await Task.Yield() at the top of ConnectTransportAsync, or to leave it as-is.
This is fine, too.

@JamesNK JamesNK force-pushed the jamesnk/executioncontext branch from 9bd6377 to 04d62dc Compare May 17, 2023 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants