Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b7d4278

Browse files
Create separate objects for isolate state and isolate group state (#14268)
Isolate data may need to be deleted on the same thread where it was allocated. In particular, the task observer set up in the UIDartState ctor must be removed from the same message loop where it was added. The engine had been using the same DartIsolate object as the root isolate data and as the isolate group data. This object would be deleted when the isolate group was shut down. However, group shutdown may occur on a thread associated with a secondary isolate. When this happens, cleanup of any state tied to the root isolate's thread will fail. This change adds a DartIsolateGroupData object holding state that is common among all isolates in a group. DartIsolateGroupData can be deleted on any thread. See flutter/flutter#45578
1 parent 721fb5b commit b7d4278

File tree

7 files changed

+321
-260
lines changed

7 files changed

+321
-260
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ FILE: ../../../flutter/lib/web_ui/lib/ui.dart
491491
FILE: ../../../flutter/lib/web_ui/tool/unicode_sync_script.dart
492492
FILE: ../../../flutter/runtime/dart_isolate.cc
493493
FILE: ../../../flutter/runtime/dart_isolate.h
494+
FILE: ../../../flutter/runtime/dart_isolate_group_data.cc
495+
FILE: ../../../flutter/runtime/dart_isolate_group_data.h
494496
FILE: ../../../flutter/runtime/dart_isolate_unittests.cc
495497
FILE: ../../../flutter/runtime/dart_lifecycle_unittests.cc
496498
FILE: ../../../flutter/runtime/dart_service_isolate.cc

runtime/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ source_set("runtime") {
4646
sources = [
4747
"dart_isolate.cc",
4848
"dart_isolate.h",
49+
"dart_isolate_group_data.cc",
50+
"dart_isolate_group_data.h",
4951
"dart_service_isolate.cc",
5052
"dart_service_isolate.h",
5153
"dart_snapshot.cc",

0 commit comments

Comments
 (0)