diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-11-08 12:16:30 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-11-08 12:17:40 +0300 |
commit | 5a534fa5d8cbac9ae15e145c2cf22443a0ca70e0 (patch) | |
tree | 106ef6d98cad1266c86d8ac5f58f8043e6e34806 /main | |
parent | 47d64cee4126a04d20be175f9dcf3202e95ad85f (diff) |
Fixes VSTS Bug 958249: System.InvalidOperationException exception
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/958249
Can't dispose ProgessMonitors that way. Some progress monitors are
re-used even if dispose is called (like BuildOutputProgressMonitor) .
That disposed remains true on these monitors is a design issue that
needs to be addressed but is not part of that bug.
The LogViewProgressMonitor is only added to an
AggregatedProgressMonitor - that one now clears all sub monitors on
Dispose so it should always be de-registered.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs | 1 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs | 11 |
2 files changed, 1 insertions, 11 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs index f5db1a8491..80c5430679 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs @@ -201,6 +201,7 @@ namespace MonoDevelop.Core.ProgressMonitoring if ((info.ActionMask & MonitorAction.FollowerCancel) != 0) info.CancellationTokenRegistration.Dispose (); } + monitors.Clear (); } void OnFollowerCancelRequested () diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs index 02394f9e8d..e0bad52376 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs @@ -144,17 +144,6 @@ 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); |