You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contains a resource/memory leak from not disposing of the disposable inside of the .Select when it gets computed at runtime for each item in it.
The best way to fix this is to use the simplified using syntax by setting <LangVersion>8</LangVersion> or newer inside of the csproj.
For .NET Framework projects I have tested that even the absolute latest language version in the latest compiler binaries (even the preview ones in VS2022 Preview) works, even when the language version of preview is used as well. Just got to be aware of what specific features to avoid however.
The text was updated successfully, but these errors were encountered:
AraHaan
changed the title
Found memory leak from never disposing of an disposable inside of a linq query.
Found memory leak from never disposing of a disposable inside of a linq query.
Nov 17, 2023
AraHaan
changed the title
Found memory leak from never disposing of a disposable inside of a linq query.
Found resource/memory leak from never disposing of a disposable inside of a linq query.
Nov 17, 2023
I only found this when I started to port the code over myself to my own project to improve it as it seems this repository is not maintained much and I needed some much needed fixes ASAP.
The code here: https://github.com/aspnet/RoslynCodeDomProvider/blob/main/src/Microsoft.CodeDom.Providers.DotNetCompilerPlatform/Compiler.cs#L52-L56
Contains a resource/memory leak from not disposing of the disposable inside of the
.Select
when it gets computed at runtime for each item in it.The best way to fix this is to use the simplified
using
syntax by setting<LangVersion>8</LangVersion>
or newer inside of the csproj.For .NET Framework projects I have tested that even the absolute latest language version in the latest compiler binaries (even the preview ones in VS2022 Preview) works, even when the language version of preview is used as well. Just got to be aware of what specific features to avoid however.
The text was updated successfully, but these errors were encountered: