mirror of https://github.com/ppy/osu
Fix potential nullref throw on failed startup
This commit is contained in:
parent
b399f910e4
commit
edb1230111
|
@ -163,8 +163,11 @@ public void ResetDatabase()
|
|||
|
||||
public void FlushConnections()
|
||||
{
|
||||
foreach (var context in threadContexts.Values)
|
||||
context.Dispose();
|
||||
if (threadContexts != null)
|
||||
{
|
||||
foreach (var context in threadContexts.Values)
|
||||
context.Dispose();
|
||||
}
|
||||
|
||||
recycleThreadContexts();
|
||||
}
|
||||
|
|
|
@ -527,7 +527,7 @@ protected override void Dispose(bool isDisposing)
|
|||
BeatmapManager?.Dispose();
|
||||
LocalConfig?.Dispose();
|
||||
|
||||
contextFactory.FlushConnections();
|
||||
contextFactory?.FlushConnections();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue