Skip to content

Commit

Permalink
Move checking for cancelled token into try-catch to guarantee that Up…
Browse files Browse the repository at this point in the history
…dateSessionState() is invoked (in finally)

(cherry picked from commit 3befe19)
  • Loading branch information
nerzhulart committed Mar 16, 2017
1 parent 3226be3 commit e9ee3d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Mono.Debugging.Soft/SoftDebuggerAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2199,11 +2199,11 @@ protected override Task<OperationResult<Value>> InvokeAsyncImpl ()
}
var tcs = new TaskCompletionSource<OperationResult<Value>> ();
invokeAsyncResult = (IInvokeAsyncResult)obj.BeginInvokeMethod (ctx.Thread, function, args, optionsToInvoke, ar => {
if (Token.IsCancellationRequested) {
tcs.SetCanceled ();
return;
}
try {
if (Token.IsCancellationRequested) {
tcs.SetCanceled ();
return;
}
var endInvokeResult = obj.EndInvokeMethodWithResult (ar);
tcs.SetResult (new SoftOperationResult (endInvokeResult.Result, false, endInvokeResult.OutArgs));
}
Expand Down

0 comments on commit e9ee3d0

Please sign in to comment.