Class WrappedNativeCallback<T>
Keep alive holder to ensure native call back delegates are not destroyed while registered with native code
Namespace: Llvm.NET.Interop
Assembly: Llvm.NET.dll
Syntax
public sealed class WrappedNativeCallback<T> : WrappedNativeCallback, IDisposable where T : Delegate
Type Parameters
T
Delegate signature of the native callback |
Remarks
This generates a holder for a delegate that allows a native function pointer for the delegate to remain valid until the instance of this wrapper is disposed. This is generally only necessary where the native call back must remain valid for an extended period of time. (e.g. beyond the call that provides the callback)
note
This doesn't actually pin the delegate, but it does add an additional reference see: https://msdn.microsoft.com/en-us/library/367eeye0.aspx for more info.
Constructors
WrappedNativeCallback(T) | Initializes a new instance of the WrappedNativeCallback<T> class. |
Methods
ToDelegate() | Gets a delegate from the raw native callback |
Operators
Implicit(WrappedNativeCallback<T> to T) | Gets a delegate from the raw native callback |