Make realm a non-drawable component to better order disposal

Until now, the `RealmContextFactory` would be disposed as part of the
drawable hierarchy. This is too early, as it may be being used by higher
level components (like `ConfigManager`s, see #15115) that perform final
operations after the drawables have been disposed.

Seems to make sense moving this out of the drawable hierarchy and in
line with how we were doing things with EF.
This commit is contained in:
Dean Herbert
2021-10-15 13:58:14 +09:00
parent d2e5c36780
commit 818fac6ac8
2 changed files with 14 additions and 13 deletions

View File

@ -187,8 +187,6 @@ namespace osu.Game
dependencies.Cache(realmFactory = new RealmContextFactory(Storage, "client"));
AddInternal(realmFactory);
dependencies.CacheAs(Storage);
var largeStore = new LargeTextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(Resources, @"Textures")));
@ -529,6 +527,7 @@ namespace osu.Game
LocalConfig?.Dispose();
contextFactory?.FlushConnections();
realmFactory?.Dispose();
}
}
}