diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-10-22 11:53:20 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-11-08 12:17:40 +0300 |
commit | 47d64cee4126a04d20be175f9dcf3202e95ad85f (patch) | |
tree | 290f03f1f57c91cf4d0ad6f844e2aa740a9ae818 /main | |
parent | 5454f45ce224ea74cdb5152de7e6e70150088068 (diff) |
Fixes VSTS Bug 958249: System.InvalidOperationException exception in MonoDevelop.Ide.Gui.Components.LogViewProgressMonitor.OnWriteLog()
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/958249
Found some event handlers that were not unregistered on dispose which
may explain that issue.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs index e0bad52376..02394f9e8d 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs @@ -144,6 +144,17 @@ namespace MonoDevelop.Core if (disposed) return; disposed = true; + if (logWriter != null) { + logWriter.TextWritten -= DoWriteLog; + logWriter.Dispose (); + logWriter = null; + } + + if (errorLogWriter != null) { + errorLogWriter.TextWritten -= DoWriteErrorLog; + errorLogWriter.Dispose (); + errorLogWriter = null; + } if (parentMonitor != null && firstCachedLogChunk != null) { parentMonitor.DumpLog (firstCachedLogChunk); |