mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Ensure the sqlite connection is correctly closed before the game ends
Hopefully fixes CI race conditions between consecutive tests.
This commit is contained in:
parent
aa5afc30ef
commit
e7c9aec1b1
@ -94,13 +94,15 @@ namespace osu.Game
|
|||||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
||||||
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||||
|
|
||||||
|
private SQLiteConnection connection;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
dependencies.Cache(this);
|
dependencies.Cache(this);
|
||||||
dependencies.Cache(LocalConfig);
|
dependencies.Cache(LocalConfig);
|
||||||
|
|
||||||
SQLiteConnection connection = Host.Storage.GetDatabase(@"client");
|
connection = Host.Storage.GetDatabase(@"client");
|
||||||
|
|
||||||
connection.CreateTable<StoreVersion>();
|
connection.CreateTable<StoreVersion>();
|
||||||
|
|
||||||
@ -237,6 +239,8 @@ namespace osu.Game
|
|||||||
LocalConfig.Save();
|
LocalConfig.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connection.Dispose();
|
||||||
|
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user