diff --git a/ILSpy/TextView/DecompilerTextView.cs b/ILSpy/TextView/DecompilerTextView.cs index d539cbf1c..a072f7311 100644 --- a/ILSpy/TextView/DecompilerTextView.cs +++ b/ILSpy/TextView/DecompilerTextView.cs @@ -60,7 +60,7 @@ namespace ICSharpCode.ILSpy.TextView /// Contains all the threading logic that makes the decompiler work in the background. /// [Export, PartCreationPolicy(CreationPolicy.Shared)] - public sealed partial class DecompilerTextView : UserControl + public sealed partial class DecompilerTextView : UserControl, IDisposable { readonly ReferenceElementGenerator referenceElementGenerator; readonly UIElementGenerator uiElementGenerator; @@ -672,6 +672,11 @@ namespace ICSharpCode.ILSpy.TextView state.DecompiledNodes = decompiledNodes; return state; } + + public void Dispose() + { + DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged -= CurrentDisplaySettings_PropertyChanged; + } } public class DecompilerTextViewState