From 1cd5ed308a9598a90aec6dcd3357aa0886450fd1 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 18 Jun 2019 22:34:04 -0700 Subject: [PATCH] Do not remove the DartServiceIsolate status callback during FlutterMain destruction (flutter/engine#9368) FlutterMain and the DartServiceIsolate callback list are both globals, and the callback list state may have already been destructed when FlutterMain's destructor runs. --- engine/src/flutter/shell/platform/android/flutter_main.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/flutter_main.cc b/engine/src/flutter/shell/platform/android/flutter_main.cc index b12fad5750..f248de06c7 100644 --- a/engine/src/flutter/shell/platform/android/flutter_main.cc +++ b/engine/src/flutter/shell/platform/android/flutter_main.cc @@ -42,11 +42,7 @@ fml::jni::ScopedJavaGlobalRef* g_flutter_jni_class = nullptr; FlutterMain::FlutterMain(flutter::Settings settings) : settings_(std::move(settings)), observatory_uri_callback_() {} -FlutterMain::~FlutterMain() { - if (observatory_uri_callback_) { - DartServiceIsolate::RemoveServerStatusCallback(observatory_uri_callback_); - } -} +FlutterMain::~FlutterMain() = default; static std::unique_ptr g_flutter_main;