mirror of
https://github.com/osukey/osukey.git
synced 2025-07-24 11:50:03 +09:00
Ensure realm contexts are flushed when update thread changes native thread
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user