Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/devtools_app_shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ found in the LICENSE file or at https://developers.google.com/open-source/licens
## 0.5.2-wip
* Fix a `RangeError` thrown by `SplitPane` when the number of children
changes between rebuilds.
* Fix garbage collection issues with the result list in `asyncEval` on both native VM and web.
* The minimum Dart SDK version is bumped to 3.11.0.
* The minimum Flutter SDK version is bumped to 3.41.0.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,20 @@ class EvalOnDartLibrary extends DisposableController
await safeEval(
'() async {'
' final reader = widgetInspectorService.toObject("$readerId", "$readerGroup") as List;'
' // Keep a strong reference to `reader` in the target app to prevent it'
' // from being garbage collected by Chrome/VM before the future resolves.'
' // Without this, the reader is only weakly referenced by the inspector'
' // service and is aggressively GCed, causing a TypeError/TimeoutException'
' // or failing the assertion that the retrieved result length is 1 or 2.'
' bool isDone = false;'
' int ticks = 0;'
' Timer.periodic(const Duration(milliseconds: 50), (timer) {'
' final _ = reader;'
' // Stop pinning after a 5-second buffer when the future has completed.'
' if (isDone && ++ticks > 100) {'
Comment thread
srawlins marked this conversation as resolved.
Outdated
' timer.cancel();'
' }'
' });'
Comment thread
srawlins marked this conversation as resolved.
Outdated
' try {'
// Cast as dynamic so that it is possible to await Future<void>
' dynamic result = ($expression) as dynamic;'
Expand All @@ -437,6 +451,7 @@ class EvalOnDartLibrary extends DisposableController
' reader.add(err);'
' reader.add(stack);'
' } finally {'
' isDone = true;'
' postEvent("future_completed", {"future_id": $futureId, "client_id": $_clientId});'
' }'
'}()',
Expand Down
Loading