Skip to content

Commit ac183d5

Browse files
David EllingsworthDavid Ellingsworth
authored andcommitted
Set the done flag once the task completes.
1 parent 39e089f commit ac183d5

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/RestSharp/AsyncHelpers.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,12 @@ async void PostCallback(object? _) {
103103
try {
104104
// Do not call ConfigureAwait(false) here to ensure all continuations are
105105
// queued on this context, not the thread pool.
106-
await _task();
106+
await _task().ContinueWith(_ => _done = true);
107107
}
108108
catch (Exception exception) {
109109
_caughtException = ExceptionDispatchInfo.Capture(exception);
110110
throw;
111111
}
112-
finally {
113-
Post(_ => _done = true, null);
114-
}
115112
}
116113
}
117114

0 commit comments

Comments
 (0)