Skip to content

Commit

Permalink
Fix m_DisposeWaitEvent
Browse files Browse the repository at this point in the history
Before m_DisposeWaitEvent was waiting inside mutex
  • Loading branch information
rube200 committed Feb 14, 2024
1 parent 05562fa commit 1dc117a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions OpenMod.Economy/Dispatcher/EconomyDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ public async ValueTask DisposeAsync()
return;

m_DisposeWaitEvent = new ManualResetEventSlim();
m_DisposeWaitEvent.Wait();
m_DisposeWaitEvent.Dispose();
}

try
{
m_DisposeWaitEvent?.Wait();
}
finally
{
m_DisposeWaitEvent?.Dispose();
m_DisposeWaitEvent = null;
}
}

Expand Down

0 comments on commit 1dc117a

Please sign in to comment.