MailWindow: Fail silently when disposing documents
All checks were successful
Test / Run tests (push) Successful in 1m49s
All checks were successful
Test / Run tests (push) Successful in 1m49s
This commit is contained in:
@@ -615,12 +615,16 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DisposeDocs() {
|
private void DisposeDocs() {
|
||||||
PrintDocument?.Dispose();
|
try {
|
||||||
PrintDocument = null;
|
PrintDocument?.Dispose();
|
||||||
|
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) {
|
||||||
d.Dispose();
|
try {
|
||||||
|
d.Dispose();
|
||||||
|
} catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EmailDocuments = null;
|
EmailDocuments = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user