From 233a976c6d55eed3ff372cb8178749ca590ebf12 Mon Sep 17 00:00:00 2001 From: zmf <279822581@qq.com> Date: Fri, 14 Jun 2024 15:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AA=E9=80=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zmf <279822581@qq.com> --- .../embedding/engine/FlutterEngineConnectionRegistry.ets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterEngineConnectionRegistry.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterEngineConnectionRegistry.ets index ca424fc894..b864a5b3fa 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterEngineConnectionRegistry.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterEngineConnectionRegistry.ets @@ -149,7 +149,11 @@ export default class FlutterEngineConnectionRegistry implements PluginRegistry, detachFromAbility(): void { if (this.isAttachedToAbility()) { - this.abilityAwarePlugins.forEach(abilityAware => abilityAware.onDetachedFromAbility()) + try { + this.abilityAwarePlugins.forEach(abilityAware => abilityAware.onDetachedFromAbility()) + } catch (e) { + Log.e(TAG, "abilityAwarePlugins DetachedFromAbility failed, msg:" + e); + } this.detachFromAbilityInternal(); } else { Log.e(TAG, "Attempted to detach plugins from an Ability when no Ability was attached."); -- Gitee