mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-02-25 09:46:01 +01:00
Fix exception while shutting down instance procedures
This commit is contained in:
parent
a9646c5bbc
commit
2180e0c067
@ -32,10 +32,6 @@ sealed class InstanceProcedureManager : IAsyncDisposable {
|
||||
return (await currentProcedure.Get(cancellationToken))?.Procedure;
|
||||
}
|
||||
|
||||
public async Task CancelCurrentProcedure() {
|
||||
(await currentProcedure.Get(shutdownCancellationTokenSource.Token))?.CancellationTokenSource.Cancel();
|
||||
}
|
||||
|
||||
private async Task Run() {
|
||||
try {
|
||||
var shutdownCancellationToken = shutdownCancellationTokenSource.Token;
|
||||
@ -77,7 +73,7 @@ sealed class InstanceProcedureManager : IAsyncDisposable {
|
||||
public async ValueTask DisposeAsync() {
|
||||
shutdownCancellationTokenSource.Cancel();
|
||||
|
||||
await CancelCurrentProcedure();
|
||||
(await currentProcedure.Get(CancellationToken.None))?.CancellationTokenSource.Cancel();
|
||||
await procedureQueueFinished.WaitHandle.WaitOneAsync();
|
||||
|
||||
currentProcedure.Dispose();
|
||||
|
Loading…
Reference in New Issue
Block a user