From 27f5a2f58e98067d4743033103073ce7fd1ad6ca Mon Sep 17 00:00:00 2001 From: gewuyou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 25 Apr 2026 09:20:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(game):=20=E6=B8=85=E7=90=86=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=AE=A1=E9=81=93=E4=B8=AD=E7=9A=84=E4=BD=8E=E9=A3=8E?= =?UTF-8?q?=E9=99=A9=20MA0004?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复 Scene 与 UI 过渡管道中间件链的多余 async 包装 - 更新低风险 await 调用以显式使用 ConfigureAwait(false) --- GFramework.Game/Scene/SceneTransitionPipeline.cs | 14 +++++++------- GFramework.Game/UI/UiTransitionPipeline.cs | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/GFramework.Game/Scene/SceneTransitionPipeline.cs b/GFramework.Game/Scene/SceneTransitionPipeline.cs index a8e93e82..2a2f0afd 100644 --- a/GFramework.Game/Scene/SceneTransitionPipeline.cs +++ b/GFramework.Game/Scene/SceneTransitionPipeline.cs @@ -148,7 +148,7 @@ public class SceneTransitionPipeline foreach (var handler in sortedHandlers) { var options = _options[handler]; - await ExecuteSingleHandlerAsync(handler, options, @event, cancellationToken); + await ExecuteSingleHandlerAsync(handler, options, @event, cancellationToken).ConfigureAwait(false); } Log.Debug("Pipeline execution completed for phases: {0}", phases); @@ -173,7 +173,7 @@ public class SceneTransitionPipeline if (handlers.Count == 0) { - await coreAction(); + await coreAction().ConfigureAwait(false); return; } @@ -191,11 +191,11 @@ public class SceneTransitionPipeline var options = _aroundOptions[handler]; var next = pipeline; - pipeline = async () => await ExecuteSingleAroundHandlerAsync( - handler, options, @event, next, cancellationToken); + pipeline = () => ExecuteSingleAroundHandlerAsync( + handler, options, @event, next, cancellationToken); } - await pipeline(); + await pipeline().ConfigureAwait(false); } private List FilterAndSortHandlers( @@ -283,7 +283,7 @@ public class SceneTransitionPipeline ? CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token) : null; - await handler.HandleAsync(@event, next, linkedCts?.Token ?? cancellationToken); + await handler.HandleAsync(@event, next, linkedCts?.Token ?? cancellationToken).ConfigureAwait(false); Log.Debug("Around handler completed: {0}", handler.GetType().Name); } @@ -296,4 +296,4 @@ public class SceneTransitionPipeline throw; } } -} \ No newline at end of file +} diff --git a/GFramework.Game/UI/UiTransitionPipeline.cs b/GFramework.Game/UI/UiTransitionPipeline.cs index 4ca005cf..49101d2f 100644 --- a/GFramework.Game/UI/UiTransitionPipeline.cs +++ b/GFramework.Game/UI/UiTransitionPipeline.cs @@ -133,7 +133,7 @@ public class UiTransitionPipeline foreach (var handler in sortedHandlers) { var options = _options[handler]; - await ExecuteSingleHandlerAsync(handler, options, @event, cancellationToken); + await ExecuteSingleHandlerAsync(handler, options, @event, cancellationToken).ConfigureAwait(false); } Log.Debug("Pipeline execution completed for phases: {0}", phases); @@ -158,7 +158,7 @@ public class UiTransitionPipeline if (handlers.Count == 0) { - await coreAction(); + await coreAction().ConfigureAwait(false); return; } @@ -176,11 +176,11 @@ public class UiTransitionPipeline var options = _aroundOptions[handler]; var next = pipeline; - pipeline = async () => await ExecuteSingleAroundHandlerAsync( + pipeline = () => ExecuteSingleAroundHandlerAsync( handler, options, @event, next, cancellationToken); } - await pipeline(); + await pipeline().ConfigureAwait(false); } private List FilterAndSortHandlers( @@ -268,7 +268,7 @@ public class UiTransitionPipeline ? CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token) : null; - await handler.HandleAsync(@event, next, linkedCts?.Token ?? cancellationToken); + await handler.HandleAsync(@event, next, linkedCts?.Token ?? cancellationToken).ConfigureAwait(false); Log.Debug("Around handler completed: {0}", handler.GetType().Name); } @@ -281,4 +281,4 @@ public class UiTransitionPipeline throw; } } -} \ No newline at end of file +}