Skip to content

Dispose IDisosables in HtmlTransformer - #5099

Merged
Jakub Jareš (nohwnd) merged 1 commit into
microsoft:mainfrom
omajid:htmltransformer-close-manifest-xmlreader-resouce-stream
Jul 8, 2024
Merged

Dispose IDisosables in HtmlTransformer#5099
Jakub Jareš (nohwnd) merged 1 commit into
microsoft:mainfrom
omajid:htmltransformer-close-manifest-xmlreader-resouce-stream

Conversation

@omajid

Copy link
Copy Markdown
Contributor

Description

There's two IDisposables being used in HtmlTransformer (a Stream and an XmlReader). We should Dispose() both of them.

I think this is mostly a hygiene issue. Assembly.GetManifestResourceStream() allocates memory only, not an some non-memory resource that has to be Dispose()d correctly. Same thing for XmlReader too. So I don't think not disposing these has any real impact.

This was flagged by a static analysis too.

Related issue

Kindly link any related issues. E.g. Fixes #xyz. -- Shall I file one?

  • I have ensured that there is a previously discussed and approved issue.

There's two IDisposables being used in HtmlTransformer. We should
Dispose() both of them.
@nohwnd

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@nohwnd
Jakub Jareš (nohwnd) merged commit e12f577 into microsoft:main Jul 8, 2024
@potnoddle

Copy link
Copy Markdown

Can I find this extension on nuget? I can see Microsoft.TestPlatform.Extensions.TrxLogger, but I heed the HtmlLogger so I can override functionality to attachments

This was referenced Aug 23, 2026
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.

3 participants