Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispose XmlReaders in System.Xml.Xpath.XPathNavigator #103294

Closed
wants to merge 1 commit into from

Conversation

omajid
Copy link
Member

@omajid omajid commented Jun 11, 2024

This code creates a number of XmlReader through various method calls. They are not disposed. Since they are IDisposables, the code should dispose them.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 11, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-xml
See info in area-owners.md if you want to be subscribed.

This code creates a number of XmlReader through various method calls.
They are not disposed. Since they are IDisposables, the code should
dispose them.
@omajid omajid force-pushed the xpathnavigator-dispose-xmlreaders branch from a7a68ad to 619962a Compare June 11, 2024 17:00
InsertAfter(reader);
}

public virtual void InsertAfter(XmlReader newSibling)
{
ArgumentNullException.ThrowIfNull(newSibling);

XmlWriter writer = InsertAfter();
using XmlWriter writer = InsertAfter();
Copy link
Member

Choose a reason for hiding this comment

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

Are any of these changes actually improving things? It's possible they could lead to performance regressions, as these are mostly methods that could otherwise be inlined (in particular with dynamic PGO), and now with the exception handling they likely won't be. I'd prefer to close this PR unless it's actually solving a real run-time problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are any of these changes actually improving things?

I have no data to make that claim.

I'd prefer to close this PR unless it's actually solving a real run-time problem.

Fair enough!

Copy link
Member

Choose a reason for hiding this comment

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

Ok, thanks

@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Xml community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants