Skip to content

Commit

Permalink
Changed to ensure that resources are disposed (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan authored Aug 22, 2023
1 parent fdd33d6 commit 7e02f74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions WinQuickLook.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ public static void Main(string[] args)
{
PInvoke.MFStartup(PInvoke.MF_VERSION, 1);

var services = new ServiceCollection();
try
{
var services = new ServiceCollection();

ConfigureService(services);
ConfigureService(services);

using var provider = services.BuildServiceProvider();

using (var provider = services.BuildServiceProvider())
{
var app = provider.GetRequiredService<App>();

app.Run();
}

PInvoke.MFShutdown();
finally
{
PInvoke.MFShutdown();
}
}

private static void ConfigureService(IServiceCollection services)
Expand Down
2 changes: 1 addition & 1 deletion WinQuickLook.CsWin32/WinQuickLook.CsWin32.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.2-beta">
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.18-beta">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down

0 comments on commit 7e02f74

Please sign in to comment.