mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
Add missing lock coverage when using subscriptionActions
dictionary
This commit is contained in:
parent
297ffec359
commit
70a120ea8a
@ -249,11 +249,13 @@ namespace osu.Game.Database
|
||||
|
||||
return new InvokeOnDisposal(() =>
|
||||
{
|
||||
// TODO: this likely needs to be run on the update thread.
|
||||
if (subscriptionActions.TryGetValue(action, out var unsubscriptionAction))
|
||||
lock (contextLock)
|
||||
{
|
||||
unsubscriptionAction?.Dispose();
|
||||
subscriptionActions.Remove(action);
|
||||
if (subscriptionActions.TryGetValue(action, out var unsubscriptionAction))
|
||||
{
|
||||
unsubscriptionAction?.Dispose();
|
||||
subscriptionActions.Remove(action);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user