Skip to content

Commit fcc4bc5

Browse files
author
David Karlaš
authored
Merge pull request #93 from JetBrains/detachFix
Set IsConnected to false on detach. Call OnDetach() inside Dispach()
2 parents ee254b9 + 67a02b7 commit fcc4bc5

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
@@ -381,12 +381,18 @@ public void AttachToProcess (ProcessInfo proc, DebuggerSessionOptions options)
381381
public void Detach ()
382382
{
383383
lock (slock) {
384-
try {
385-
OnDetach ();
386-
} catch (Exception ex) {
387-
if (!HandleException (ex))
388-
throw;
389-
}
384+
Dispatch (delegate {
385+
try {
386+
OnDetach ();
387+
}
388+
catch (Exception ex) {
389+
if (!HandleException (ex))
390+
throw;
391+
}
392+
finally {
393+
IsConnected = false;
394+
}
395+
});
390396
}
391397
}
392398

0 commit comments

Comments
 (0)