Skip to content

Ensure UrlSession is cleaned up on dispose#24377

Closed
dotMorten wants to merge 2 commits intodotnet:mainfrom
dotMorten:patch-1
Closed

Ensure UrlSession is cleaned up on dispose#24377
dotMorten wants to merge 2 commits intodotnet:mainfrom
dotMorten:patch-1

Conversation

@dotMorten
Copy link
Copy Markdown
Contributor

@rolfbjarne rolfbjarne added the community Community contribution ❤ label Dec 8, 2025
@rolfbjarne rolfbjarne self-assigned this Dec 8, 2025
configuration.HttpCookieStorage = null;
}
session = NSUrlSession.FromConfiguration (configuration, (INSUrlSessionDelegate) new NSUrlSessionHandlerDelegate (this), null);
oldSession.FinishTasksAndInvalidate ();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is needed, because at the beginning in this setter we make sure there have been no requests made yet (so there are no tasks that need to finish):

EnsureModifiability ();

@rolfbjarne
Copy link
Copy Markdown
Member

I'll have a look and see if I can reproduce this and create a test!

@rolfbjarne
Copy link
Copy Markdown
Member

Closing in favor of #24384 (because our CI won't work with PRs from forks).

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

Labels

community Community contribution ❤

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NSUrlSessionHandler.Dispose doesn't fully clean up

2 participants