From b84ca13f5026d9a7fed90a57a4afa3b09737d54a Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 13 Apr 2011 20:37:12 +0200 Subject: [PATCH] Observe assembly load exceptions so that we don't crash when the Task's finalizer kicks in. Closes #54. --- ILSpy/TreeNodes/AssemblyTreeNode.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ILSpy/TreeNodes/AssemblyTreeNode.cs b/ILSpy/TreeNodes/AssemblyTreeNode.cs index 2d3aad07e..12211e632 100644 --- a/ILSpy/TreeNodes/AssemblyTreeNode.cs +++ b/ILSpy/TreeNodes/AssemblyTreeNode.cs @@ -89,6 +89,8 @@ namespace ICSharpCode.ILSpy.TreeNodes RaisePropertyChanged("ExpandedIcon"); if (assemblyTask.IsFaulted) { RaisePropertyChanged("ShowExpander"); // cannot expand assemblies with load error + // observe the exception so that the Task's finalizer doesn't re-throw it + try { assemblyTask.Wait(); } catch (AggregateException) {} } else { RaisePropertyChanged("Text"); // shortname might have changed }