Skip to content

Commit 67a02b7

Browse files
committed
Set IsConnected to false on detach. Call OnDetach() inside Dispach()
1 parent 2c1ca37 commit 67a02b7

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,18 @@ public void AttachToProcess (ProcessInfo proc, DebuggerSessionOptions options)
377377
public void Detach ()
378378
{
379379
lock (slock) {
380-
try {
381-
OnDetach ();
382-
} catch (Exception ex) {
383-
if (!HandleException (ex))
384-
throw;
385-
}
380+
Dispatch (delegate {
381+
try {
382+
OnDetach ();
383+
}
384+
catch (Exception ex) {
385+
if (!HandleException (ex))
386+
throw;
387+
}
388+
finally {
389+
IsConnected = false;
390+
}
391+
});
386392
}
387393
}
388394

0 commit comments

Comments
 (0)