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

Commit 2fb6cd9

Browse files
mralephcommit-bot@chromium.org
authored andcommitted
[vm] Fix Service::RequestAssets
Unwrapping of API handles can only occur when thread is in the VM execution state. Change-Id: I14183f4553d0dd972b4bafb1e3771cf2655c1867 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96040 Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
1 parent 585eb7f commit 2fb6cd9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

runtime/vm/service.cc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,16 @@ RawObject* Service::RequestAssets() {
173173
Object& object = Object::Handle();
174174
{
175175
Api::Scope api_scope(T);
176-
TransitionVMToNative transition(T);
177-
if (get_service_assets_callback_ == NULL) {
178-
return Object::null();
179-
}
180-
Dart_Handle handle = get_service_assets_callback_();
181-
if (Dart_IsError(handle)) {
182-
Dart_PropagateError(handle);
176+
Dart_Handle handle;
177+
{
178+
TransitionVMToNative transition(T);
179+
if (get_service_assets_callback_ == NULL) {
180+
return Object::null();
181+
}
182+
handle = get_service_assets_callback_();
183+
if (Dart_IsError(handle)) {
184+
Dart_PropagateError(handle);
185+
}
183186
}
184187
object = Api::UnwrapHandle(handle);
185188
}

0 commit comments

Comments
 (0)