Skip to content

Commit

Permalink
ensure callback handler is not garbage collected (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
fw2568 authored Aug 15, 2020
1 parent 488c3cd commit 3a25a44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/YaNco.Native.Interop/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static void AllowStartOfPrograms(ConnectionHandle connectionHandle, Start
return;
}

rc = Interopt.RfcInstallServerFunction(null, descriptionHandle.Ptr, RFC_START_PROGRAM_Handler, out errorInfo);
rc = Interopt.RfcInstallServerFunction(null, descriptionHandle.Ptr, StartProgramHandler, out errorInfo);
if (rc != RfcRc.RFC_OK)
{
return;
Expand All @@ -165,6 +165,7 @@ public static void AllowStartOfPrograms(ConnectionHandle connectionHandle, Start
}

public static StartProgramDelegate StartProgramCallback;
private static readonly Interopt.RfcServerFunction StartProgramHandler = RFC_START_PROGRAM_Handler;

static RfcRc RFC_START_PROGRAM_Handler(IntPtr rfcHandle, IntPtr funcHandle, out RfcErrorInfo errorInfo)
{
Expand Down

0 comments on commit 3a25a44

Please sign in to comment.