From 5903ac6ace7956fd550189af2d7620a479733c02 Mon Sep 17 00:00:00 2001 From: Ian Griffiths Date: Thu, 27 Jul 2023 22:24:54 +0100 Subject: [PATCH] Retain cancel callback until ForEachAsync completes (#1981) --- .../System.Reactive.Async/Linq/Operators/ForEachAsync.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AsyncRx.NET/System.Reactive.Async/Linq/Operators/ForEachAsync.cs b/AsyncRx.NET/System.Reactive.Async/Linq/Operators/ForEachAsync.cs index fdbc96490b..2caf10703b 100644 --- a/AsyncRx.NET/System.Reactive.Async/Linq/Operators/ForEachAsync.cs +++ b/AsyncRx.NET/System.Reactive.Async/Linq/Operators/ForEachAsync.cs @@ -124,9 +124,9 @@ private static async Task ForEachAsyncCore(IAsyncObservable so var d = await source.SubscribeAsync(o).ConfigureAwait(false); await subscription.AssignAsync(d).ConfigureAwait(false); - } - await tcs.Task.ConfigureAwait(false); + await tcs.Task.ConfigureAwait(false); + } } } }