Fix potential nullref throw on failed startup

This commit is contained in:
Dean Herbert 2021-09-16 22:48:09 +09:00
parent b399f910e4
commit edb1230111
2 changed files with 6 additions and 3 deletions

View File

@ -162,9 +162,12 @@ namespace osu.Game.Database
}
public void FlushConnections()
{
if (threadContexts != null)
{
foreach (var context in threadContexts.Values)
context.Dispose();
}
recycleThreadContexts();
}

View File

@ -527,7 +527,7 @@ namespace osu.Game
BeatmapManager?.Dispose();
LocalConfig?.Dispose();
contextFactory.FlushConnections();
contextFactory?.FlushConnections();
}
}
}