diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 20ca64b8578e9..112eb41a3c95c 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -32,6 +32,7 @@ #include "third_party/skia/include/core/SkGraphics.h" #include "third_party/skia/include/utils/SkBase64.h" #include "third_party/tonic/common/log.h" +#include "third_party/tonic/dart_state.h" namespace flutter { @@ -899,6 +900,11 @@ void Shell::OnPlatformViewDestroyed() { // Overall, the longer term plan is to remove this implementation once // https://github.com/flutter/flutter/issues/96679 is fixed. rasterizer_->TeardownExternalViewEmbedder(); + + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), [] { + tonic::DartState::Scope scope(tonic::DartState::Current()); + ::Dart_NotifyDestroyed(); + }); } // |PlatformView::Delegate|