diff --git a/DEPS b/DEPS index e38daef675..57014c8cb9 100644 --- a/DEPS +++ b/DEPS @@ -34,7 +34,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '57462f9ca52000932d2ac82613808131650b440c', + 'dart_revision': 'df5036eb6e738c723339ed74c1e8ca93bea2570d', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py diff --git a/engine/src/flutter/third_party/tonic/dart_persistent_value.cc b/engine/src/flutter/third_party/tonic/dart_persistent_value.cc index 9ed6f70f35..3bc46505d3 100644 --- a/engine/src/flutter/third_party/tonic/dart_persistent_value.cc +++ b/engine/src/flutter/third_party/tonic/dart_persistent_value.cc @@ -43,8 +43,12 @@ void DartPersistentValue::Clear() { return; } - DartIsolateScope scope(dart_state->isolate()); - Dart_DeletePersistentHandle(value_); + if (Dart_CurrentIsolateGroup()) { + Dart_DeletePersistentHandle(value_); + } else { + DartIsolateScope scope(dart_state->isolate()); + Dart_DeletePersistentHandle(value_); + } dart_state_.reset(); value_ = nullptr; } diff --git a/engine/src/flutter/third_party/tonic/dart_wrappable.cc b/engine/src/flutter/third_party/tonic/dart_wrappable.cc index 4ebfda7e1a..d0906646f3 100644 --- a/engine/src/flutter/third_party/tonic/dart_wrappable.cc +++ b/engine/src/flutter/third_party/tonic/dart_wrappable.cc @@ -64,7 +64,7 @@ void DartWrappable::ClearDartWrapper() { TONIC_CHECK(!LogIfError(Dart_SetNativeInstanceField(wrapper, kPeerIndex, 0))); TONIC_CHECK( !LogIfError(Dart_SetNativeInstanceField(wrapper, kWrapperInfoIndex, 0))); - Dart_DeleteWeakPersistentHandle(Dart_CurrentIsolate(), dart_wrapper_); + Dart_DeleteWeakPersistentHandle(dart_wrapper_); dart_wrapper_ = nullptr; this->ReleaseDartWrappableReference(); }