mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-09 22:55:42 +00:00
Suppress CA2000, false positive
This value is in fact disposed, just not here. See DestroyNative(nint)
This commit is contained in:
parent
220eeeec69
commit
fbfbab03f3
@ -76,11 +76,13 @@ internal sealed class Connection : IDisposable
|
||||
|
||||
public static nint CreateNative(nint vpConnection, nint context)
|
||||
{
|
||||
#pragma warning disable CA2000
|
||||
GCHandle contextHandle = GCHandle.FromIntPtr(context);
|
||||
var connection = new Connection(vpConnection, contextHandle.Target!);
|
||||
GCHandle handle = GCHandle.Alloc(connection, GCHandleType.Normal);
|
||||
var ptr = GCHandle.ToIntPtr(handle);
|
||||
return ptr;
|
||||
#pragma warning restore CA2000
|
||||
}
|
||||
|
||||
public static void DestroyNative(nint ptr)
|
||||
|
Loading…
Reference in New Issue
Block a user