Skip to content

Dispose StreamReader reading from disk in XmlDocReader#2441

Open
omajid wants to merge 1 commit intodotnet:mainfrom
omajid:xmldocreader-tryload-resource-leak
Open

Dispose StreamReader reading from disk in XmlDocReader#2441
omajid wants to merge 1 commit intodotnet:mainfrom
omajid:xmldocreader-tryload-resource-leak

Conversation

@omajid
Copy link
Member

@omajid omajid commented Jun 10, 2024

We create a StreamReader via File.OpenText, but never Dispose() it. Wrap it in a using statement to automatically Dispose() it when TryLoad(TextReader, ...) is done using it.

We create a `StreamReader` via `File.OpenText`, but never `Dispose()`
it. Wrap it in a `using` statement to automatically `Dispose()` it when
`TryLoad(TextReader, ...)` is done using it.
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.

1 participant