mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
For isolates spawned by the application via `Isolate.spawn()`ed, the VM will create a "lightweight" isolate and invoke the `initialize_isolate` embedder callback to initialize it. The embedder-provided callback will be invoked with the active isolate and is expected to return with that active isolate - irrespective of whether it succeeded to initialize or not. => The unsuccessful path was using `Dart_ExitIsolate()` - which is incorrect. This PR fixes that by not exiting the isolate. As a side-effect of the fix, we also do less `Dart_EnterIsolate()`/`Dart_ExitIsolate()` calls in initialization (which makes it faster) and handle failure to spawn the root isolate. Furthermore this PR removes some dead code and replaces it with `FML_DCHECK()`s instead. The PR adds a test that will set the root library to null which will make the engine fail initializing of the isolate and therefore trigger this error handling path. Fixes https://github.com/flutter/flutter/issues/90478
Fix incorrect handling of error handling in case an isolate initialization fails (flutter/engine#31207)
Description
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
androidapp-frameworkcross-platformdartdart-platformdesktopflutterflutter-packagefuchsiaioslinux-desktopmacosmaterial-designmobilemobile-developmentskiawebweb-frameworkwindows
2.5 GiB
Languages
Dart
75%
C++
16.5%
Objective-C++
2.9%
Java
2.8%
Objective-C
0.7%
Other
1.9%