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() { private void DisposeDocs() {
try {
PrintDocument?.Dispose(); PrintDocument?.Dispose();
PrintDocument = null; PrintDocument = null;
} catch { }
if (EmailDocuments != null) { if (EmailDocuments != null) {
foreach (var (m, docs) in EmailDocuments) { foreach (var (m, docs) in EmailDocuments) {
foreach (var d in docs) { foreach (var d in docs) {
try {
d.Dispose(); d.Dispose();
} catch { }
} }
} }
EmailDocuments = null; EmailDocuments = null;