mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Misc
This commit is contained in:
@@ -128,12 +128,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync() {
|
||||
// Those are objects that are always being created if constructor doesn't throw exception
|
||||
MatchActivelySemaphore.Dispose();
|
||||
RequestsSemaphore.Dispose();
|
||||
WebBrowser.Dispose();
|
||||
|
||||
// Those are objects that might be null and the check should be in-place
|
||||
// Dispose timers first so we won't launch new events
|
||||
if (HeartBeatTimer != null) {
|
||||
await HeartBeatTimer.DisposeAsync().ConfigureAwait(false);
|
||||
}
|
||||
@@ -144,6 +139,14 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
|
||||
MatchActivelyTimer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the semaphores are closed, then dispose the rest
|
||||
await MatchActivelySemaphore.WaitAsync().ConfigureAwait(false);
|
||||
await RequestsSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
|
||||
MatchActivelySemaphore.Dispose();
|
||||
RequestsSemaphore.Dispose();
|
||||
WebBrowser.Dispose();
|
||||
}
|
||||
|
||||
internal void OnNewItemsNotification() => ShouldSendAnnouncementEarlier = true;
|
||||
|
||||
Reference in New Issue
Block a user