Add OnStopped method to dispose of _linkedTokenSource
This commit introduces the OnStopped method in the WorkflowInstanceImpl class to properly dispose of _linkedTokenSource. This change ensures that resources are appropriately cleaned up when the actor is stopped, preventing potential memory leaks.
This commit is contained in:
parent
95476cac99
commit
3b304c8e08
|
|
@ -47,6 +47,12 @@ internal class WorkflowInstanceImpl(
|
|||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnStopped()
|
||||
{
|
||||
_linkedTokenSource.Dispose();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task<ProtoCreateWorkflowInstanceResponse> Create(ProtoCreateWorkflowInstanceRequest request) => throw new NotImplementedException();
|
||||
|
||||
public override Task Create(ProtoCreateWorkflowInstanceRequest request, Action<ProtoCreateWorkflowInstanceResponse> respond, Action<string> onError)
|
||||
|
|
|
|||
Loading…
Reference in a new issue