-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[System.Net.Quic]Release configuration resource. #53857
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsRelease configuration resource to prevent memory leaks.
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsRelease configuration resource to prevent memory leaks.
|
Hi @shuxinqin, Thank you for the contribution! This needs to be locally tested with msquic before merging since we don't have a CI set up for it yet. Do you think that's something you could do? I assume you were able to build msquic and use it with runtime. Or is this something you'd rather leave to us? |
I downloaded the source code(System.Net.Quic) and change some codes to make it run in unity(netstandard2.0). If the resource is not released correctly when Application quiting, the unity editor will be stuck. So i have to release configuration resource when MsQuicConnection.Dispose() called, then the problem was solved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ManickaP @wfurt public static class MsQuicInterop
{
/// <summary>
/// Releases Registration.
/// </summary>
public static void Free()
{
if (MsQuicApi.Api == null)
return;
if (MsQuicApi.Api.Registration == null)
return;
if (!MsQuicApi.Api.Registration.IsClosed)
{
MsQuicApi.Api.Registration.Close();
}
MsQuicApi.Api?.Registration?.Dispose();
}
} Calls
|
Thanks for bringing this up. I don't think we have (or at least I'm not aware of) any plans to change the lifetime management of |
I think it should be unity editor problem, thanks! |
@jeffschwMSFT is it possible to load/unload .NET from a process? This is the only danger I see. |
.NET is not unloaded from a process. |
Release configuration resource to prevent memory leaks.