Untis-API: Download Bug behoben

This commit is contained in:
2026-08-24 22:06:42 +02:00
parent 34a9fdf73b
commit 1db16f8b69
3 changed files with 45 additions and 5 deletions
+11 -1
View File
@@ -112,7 +112,17 @@ public class App : Application
}
finally
{
_serviceProvider.Dispose();
// Der direkte WebUntis-Client meldet seine Sitzung asynchron ab. Ein synchrones
// ServiceProvider.Dispose() lehnt reine IAsyncDisposable-Dienste ab und ließ die App
// beim Schließen mit InvalidOperationException abstürzen.
try
{
_serviceProvider.DisposeAsync().AsTask().GetAwaiter().GetResult();
}
catch (Exception ex)
{
AppBootstrapper.Logger.Error("Dienste konnten beim Beenden nicht vollständig freigegeben werden.", ex);
}
_serviceProvider = null;
}
}