mirror of
https://github.com/winfsp/winfsp.git
synced 2025-12-21 03:22:45 -06:00
src: dotnet: fix UnmanagedFunctionPointer delegate lifetime
This commit is contained in:
@@ -33,7 +33,7 @@ namespace Fsp
|
||||
/* ctor/dtor */
|
||||
public Service(String ServiceName)
|
||||
{
|
||||
Api.FspServiceCreate(ServiceName, OnStart, OnStop, null, out _Service);
|
||||
Api.FspServiceCreate(ServiceName, _OnStart, _OnStop, null, out _Service);
|
||||
if (IntPtr.Zero != _Service)
|
||||
Api.SetUserContext(_Service, this);
|
||||
}
|
||||
@@ -150,6 +150,8 @@ namespace Fsp
|
||||
}
|
||||
}
|
||||
|
||||
private static Api.Proto.ServiceStart _OnStart = OnStart;
|
||||
private static Api.Proto.ServiceStop _OnStop = OnStop;
|
||||
private IntPtr _Service;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user