mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-22 19:58:48 +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)
|
public static nint CreateNative(nint vpConnection, nint context)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable CA2000
|
||||||
GCHandle contextHandle = GCHandle.FromIntPtr(context);
|
GCHandle contextHandle = GCHandle.FromIntPtr(context);
|
||||||
var connection = new Connection(vpConnection, contextHandle.Target!);
|
var connection = new Connection(vpConnection, contextHandle.Target!);
|
||||||
GCHandle handle = GCHandle.Alloc(connection, GCHandleType.Normal);
|
GCHandle handle = GCHandle.Alloc(connection, GCHandleType.Normal);
|
||||||
var ptr = GCHandle.ToIntPtr(handle);
|
var ptr = GCHandle.ToIntPtr(handle);
|
||||||
return ptr;
|
return ptr;
|
||||||
|
#pragma warning restore CA2000
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DestroyNative(nint ptr)
|
public static void DestroyNative(nint ptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user