MailWindow: Fail silently when disposing documents
All checks were successful
Test / Run tests (push) Successful in 1m49s

This commit is contained in:
2026-03-27 12:16:41 +01:00
parent 3c52156b7e
commit ae0a082421

View File

@@ -615,12 +615,16 @@ namespace Elwig.Windows {
}
private void DisposeDocs() {
PrintDocument?.Dispose();
PrintDocument = null;
try {
PrintDocument?.Dispose();
PrintDocument = null;
} catch { }
if (EmailDocuments != null) {
foreach (var (m, docs) in EmailDocuments) {
foreach (var d in docs) {
d.Dispose();
try {
d.Dispose();
} catch { }
}
}
EmailDocuments = null;