Skip to content

Commit

Permalink
Upgrade to Sqlite 6_0_1 (#531)
Browse files Browse the repository at this point in the history
* Upgrade sqlite Nuget to 6.0.1

* Call SqliteConnection.ClearAllPools() in tests so that everything is closed properly
  • Loading branch information
paladine authored Jan 6, 2022
1 parent 62ee6dc commit ffac284
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions MBBSEmu.Tests/Btrieve/BtrieveFileProcessor_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public BtrieveFileProcessor_Tests()

public void Dispose()
{
SqliteConnection.ClearAllPools();

Directory.Delete(_modulePath, recursive: true);
}

Expand Down
3 changes: 3 additions & 0 deletions MBBSEmu.Tests/DOS/BtrieveRuntime_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using MBBSEmu.DOS;
using MBBSEmu.IO;
using MBBSEmu.Resources;
using Microsoft.Data.Sqlite;
using NLog;
using System;
using System.IO;
Expand Down Expand Up @@ -33,6 +34,8 @@ public BtrieveRuntime_Tests()

public void Dispose()
{
SqliteConnection.ClearAllPools();

Directory.Delete(_modulePath, recursive: true);
}

Expand Down
5 changes: 5 additions & 0 deletions MBBSEmu.Tests/Integration/MBBSEmuIntegrationTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using MBBSEmu.Resources;
using MBBSEmu.Session;
using MBBSEmu.TextVariables;
using Microsoft.Data.Sqlite;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -35,6 +36,10 @@ public MBBSEmuIntegrationTestBase()

public void Dispose()
{
_serviceResolver.Dispose();

SqliteConnection.ClearAllPools();

Directory.Delete(_modulePath, recursive: true);
}

Expand Down
1 change: 1 addition & 0 deletions MBBSEmu/Btrieve/BtrieveFileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void Dispose()
{
cmd.Dispose();
}
_sqlCommands.Clear();

Connection.Close();
Connection.Dispose();
Expand Down
2 changes: 2 additions & 0 deletions MBBSEmu/Btrieve/BtrieveQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class SqliteReader : IDisposable
public void Dispose()
{
DataReader?.Dispose();
// Purposefully not Disposing of Command because it's likely cached by BtrieveFileProcessor, so let that class
// handle the cleanup
}
}

Expand Down
2 changes: 1 addition & 1 deletion MBBSEmu/MBBSEmu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Iced" Version="1.10.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.12" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
Expand Down

0 comments on commit ffac284

Please sign in to comment.