Browse Source

Fix "Collection modified during enumeration" exception in Debugger.Detach().

pull/507/head
Daniel Grunwald 11 years ago
parent
commit
37efb859f0
  1. 3
      src/AddIns/Debugger/Debugger.Core/NDebugger.cs

3
src/AddIns/Debugger/Debugger.Core/NDebugger.cs

@ -19,6 +19,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using Debugger.Interop; using Debugger.Interop;
@ -265,7 +266,7 @@ namespace Debugger
public void Detach() public void Detach()
{ {
// Detach all processes. // Detach all processes.
foreach(Process process in this.Processes) { foreach(Process process in this.Processes.ToArray()) {
if (process == null || process.HasExited) if (process == null || process.HasExited)
continue; continue;
process.Detach(); process.Detach();

Loading…
Cancel
Save