mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Resolve CA1063
This commit is contained in:
@@ -111,7 +111,6 @@ dotnet_diagnostic.ca1028.severity = silent
|
||||
dotnet_diagnostic.ca1031.severity = silent
|
||||
|
||||
# TODO - one at a time
|
||||
dotnet_diagnostic.ca1063.severity = silent
|
||||
dotnet_diagnostic.ca1303.severity = silent
|
||||
dotnet_diagnostic.ca1307.severity = silent
|
||||
dotnet_diagnostic.ca1308.severity = silent
|
||||
|
||||
@@ -106,15 +106,20 @@ namespace ArchiSteamFarm {
|
||||
MatchActivelyBlacklistedAppIDs.OnModified += OnObjectModified;
|
||||
}
|
||||
|
||||
public override void Dispose() {
|
||||
BlacklistedFromTradesSteamIDs.OnModified -= OnObjectModified;
|
||||
IdlingBlacklistedAppIDs.OnModified -= OnObjectModified;
|
||||
IdlingPriorityAppIDs.OnModified -= OnObjectModified;
|
||||
MatchActivelyBlacklistedAppIDs.OnModified -= OnObjectModified;
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing) {
|
||||
// Events we registered
|
||||
BlacklistedFromTradesSteamIDs.OnModified -= OnObjectModified;
|
||||
IdlingBlacklistedAppIDs.OnModified -= OnObjectModified;
|
||||
IdlingPriorityAppIDs.OnModified -= OnObjectModified;
|
||||
MatchActivelyBlacklistedAppIDs.OnModified -= OnObjectModified;
|
||||
|
||||
BackingMobileAuthenticator?.Dispose();
|
||||
// Those are objects that might be null and the check should be in-place
|
||||
BackingMobileAuthenticator?.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose();
|
||||
// Base dispose
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
internal void AddGamesToRedeemInBackground(IOrderedDictionary games) {
|
||||
|
||||
@@ -107,15 +107,17 @@ namespace ArchiSteamFarm {
|
||||
[JsonConstructor]
|
||||
private GlobalDatabase() => ServerListProvider.ServerListUpdated += OnObjectModified;
|
||||
|
||||
public override void Dispose() {
|
||||
// Events we registered
|
||||
ServerListProvider.ServerListUpdated -= OnObjectModified;
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing) {
|
||||
// Events we registered
|
||||
ServerListProvider.ServerListUpdated -= OnObjectModified;
|
||||
|
||||
// Those are objects that are always being created if constructor doesn't throw exception
|
||||
PackagesRefreshSemaphore.Dispose();
|
||||
// Those are objects that are always being created if constructor doesn't throw exception
|
||||
PackagesRefreshSemaphore.Dispose();
|
||||
}
|
||||
|
||||
// Base dispose
|
||||
base.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
internal static async Task<GlobalDatabase?> CreateOrLoad(string filePath) {
|
||||
|
||||
@@ -34,12 +34,17 @@ namespace ArchiSteamFarm.Helpers {
|
||||
private bool ReadOnly;
|
||||
private bool SavingScheduled;
|
||||
|
||||
public virtual void Dispose() {
|
||||
FileSemaphore.Dispose();
|
||||
|
||||
public void Dispose() {
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing) {
|
||||
if (disposing) {
|
||||
FileSemaphore.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task Save() {
|
||||
if (string.IsNullOrEmpty(FilePath)) {
|
||||
throw new InvalidOperationException(nameof(FilePath));
|
||||
|
||||
Reference in New Issue
Block a user