Skip to content

Commit

Permalink
Dispose IDisosables in HtmlTransformer (#5099)
Browse files Browse the repository at this point in the history
There's two IDisposables being used in HtmlTransformer. We should
Dispose() both of them.
  • Loading branch information
omajid authored Jul 8, 2024
1 parent a1f5a65 commit e12f577
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ internal class HtmlTransformer : IHtmlTransformer
public HtmlTransformer()
{
_xslTransform = new XslCompiledTransform();
_xslTransform.Load(XmlReader.Create(GetType().Assembly.GetManifestResourceStream("Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.Html.xslt") ?? throw new InvalidOperationException(), new XmlReaderSettings { CheckCharacters = false }));
using var reader = XmlReader.Create(GetType().Assembly.GetManifestResourceStream("Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.Html.xslt") ?? throw new InvalidOperationException(), new XmlReaderSettings { CheckCharacters = false, CloseInput = true });
_xslTransform.Load(reader);
}

/// <summary>
Expand Down

0 comments on commit e12f577

Please sign in to comment.