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:
parent
2bea44fe94
commit
a4b66bec2e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user