Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 37efb85

Browse files
committed
Fix "Collection modified during enumeration" exception in Debugger.Detach().
1 parent 41cd4d6 commit 37efb85

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System;
2020
using System.Collections.Generic;
2121
using System.IO;
22+
using System.Linq;
2223
using System.Text;
2324
using System.Threading;
2425
using Debugger.Interop;
@@ -265,7 +266,7 @@ public Process Attach(System.Diagnostics.Process existingProcess)
265266
public void Detach()
266267
{
267268
// Detach all processes.
268-
foreach(Process process in this.Processes) {
269+
foreach(Process process in this.Processes.ToArray()) {
269270
if (process == null || process.HasExited)
270271
continue;
271272
process.Detach();

0 commit comments

Comments
 (0)