1
0
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:
Dean Herbert 2022-01-23 18:00:24 +09:00
parent 297ffec359
commit 70a120ea8a

View File

@ -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);
}
}
});
}