diff --git a/src/AddIns/Debugger/Debugger.Core/NDebugger.cs b/src/AddIns/Debugger/Debugger.Core/NDebugger.cs index e2cc15a5a6..ed7c9e13b0 100644 --- a/src/AddIns/Debugger/Debugger.Core/NDebugger.cs +++ b/src/AddIns/Debugger/Debugger.Core/NDebugger.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Threading; using Debugger.Interop; @@ -265,7 +266,7 @@ namespace Debugger public void Detach() { // Detach all processes. - foreach(Process process in this.Processes) { + foreach(Process process in this.Processes.ToArray()) { if (process == null || process.HasExited) continue; process.Detach();