Skip to content

Commit

Permalink
Testing again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simnico99 committed Jan 11, 2023
1 parent 4383435 commit e717c62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ private async static Task RunWpfApplicationAsyncInternal<T>(IHostBuilder builder

using var host = builder.Build();
var window = host.Services.GetRequiredService<T>();
var applicationLifetime = host.Services.GetRequiredService<IHostApplicationLifetime>();
applicationLifetime.ApplicationStopped.Register(() => host?.Dispose());

await host.StartAsync(cancellationToken);
await window.ShowDialogAsync();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace ZirconNet.WPF.Hosting.Lifetime;
public class WpfApplicationLifetimeOptions
public sealed class WpfApplicationLifetimeOptions
{
/// <summary>
/// Indicates if host lifetime status messages should be suppressed such as on startup.
Expand Down

0 comments on commit e717c62

Please sign in to comment.