Skip to content

Commit

Permalink
Issue changes
Browse files Browse the repository at this point in the history
  • Loading branch information
malciin committed Feb 4, 2024
1 parent cebe425 commit e031693
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MauiProgram.cs
Expand Up @@ -15,12 +15,17 @@ public static MauiApp CreateMauiApp()
});

builder.Services.AddMauiBlazorWebView();
builder.Services.AddSingleton<SingletonServiceThatRequiresDispose>();

#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif

return builder.Build();
var mauiApp = builder.Build();

mauiApp.Services.GetRequiredService<SingletonServiceThatRequiresDispose>();

return mauiApp;
}
}
9 changes: 9 additions & 0 deletions SingletonServiceThatRequiresDispose.cs
@@ -0,0 +1,9 @@
namespace ServiceDisposalBlazorIssue;

internal class SingletonServiceThatRequiresDispose : IDisposable
{
public void Dispose()
{
Console.WriteLine("I am never called!");
}
}

0 comments on commit e031693

Please sign in to comment.