1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 23:43:03 +08:00

Ensure realm contexts are flushed when update thread changes native thread

This commit is contained in:
Dean Herbert 2021-06-22 18:18:25 +09:00
parent 2bea44fe94
commit a4b66bec2e

View File

@ -182,6 +182,13 @@ namespace osu.Game
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
dependencies.Cache(realmFactory = new RealmContextFactory(Storage));
Host.UpdateThreadChanging += () =>
{
var blocking = realmFactory.BlockAllOperations();
Schedule(() => blocking.Dispose());
};
AddInternal(realmFactory);
dependencies.CacheAs(Storage);