mirror of
https://github.com/ppy/osu
synced 2025-01-02 20:32:10 +00:00
Add locking over realmSubscriptionsResetMap
for sanity
This commit is contained in:
parent
351c766ea1
commit
997c13f643
@ -243,9 +243,11 @@ namespace osu.Game.Database
|
||||
if (!ThreadSafety.IsUpdateThread)
|
||||
throw new InvalidOperationException(@$"{nameof(Register)} must be called from the update thread.");
|
||||
|
||||
realmSubscriptionsResetMap.Add(action, () => onChanged(new EmptyRealmSet<T>(), null, null));
|
||||
|
||||
return Register(action);
|
||||
lock (contextLock)
|
||||
{
|
||||
realmSubscriptionsResetMap.Add(action, () => onChanged(new EmptyRealmSet<T>(), null, null));
|
||||
return Register(action);
|
||||
}
|
||||
|
||||
IDisposable? action(Realm realm) => query(realm).QueryAsyncWithNotifications(onChanged);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user