Skip to content

Commit

Permalink
Fixed: ObjectDisposedException The semaphore has been disposed
Browse files Browse the repository at this point in the history
  • Loading branch information
skibitsky committed Dec 5, 2023
1 parent 0ef69f5 commit 9dcc02c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Core Modules/WalletConnectSharp.Storage/FileSystemStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class FileSystemStorage : InMemoryStorage
/// </summary>
public string FilePath { get; private set; }

private readonly SemaphoreSlim _semaphoreSlim = new(1);
private SemaphoreSlim _semaphoreSlim;

/// <summary>
/// A new FileSystemStorage module that reads/writes all storage
Expand All @@ -39,9 +39,10 @@ public FileSystemStorage(string filePath = null)
/// as well as loads in the JSON file
/// </summary>
/// <returns></returns>
public override Task Init()
public override async Task Init()
{
return Task.WhenAll(
_semaphoreSlim = new SemaphoreSlim(1, 1);
await Task.WhenAll(
Load(), base.Init()
);
}
Expand Down

0 comments on commit 9dcc02c

Please sign in to comment.