use UnmanagedCallersOnly for delegates

This commit is contained in:
Emmanuel Hansen
2024-09-16 13:07:31 +00:00
committed by Evan Husted
parent 3e5b2bda38
commit c8d598d5ac
14 changed files with 652 additions and 670 deletions

View File

@@ -4,15 +4,9 @@ namespace ARMeilleure.Translation
{
class DelegateInfo
{
#pragma warning disable IDE0052 // Remove unread private member
private readonly Delegate _dlg; // Ensure that this delegate will not be garbage collected.
#pragma warning restore IDE0052
public nint FuncPtr { get; }
public DelegateInfo(Delegate dlg, nint funcPtr)
public nint FuncPtr { get; private set; }
public DelegateInfo(nint funcPtr)
{
_dlg = dlg;
FuncPtr = funcPtr;
}
}