Skip to content

Commit

Permalink
Call request on platform thread (flutter#25004)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryQian authored Mar 16, 2021
1 parent aa66ad4 commit 1b62b47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shell/common/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,12 @@ void Shell::UpdateAssetResolverByType(

// |Engine::Delegate|
void Shell::RequestDartDeferredLibrary(intptr_t loading_unit_id) {
platform_view_->RequestDartDeferredLibrary(loading_unit_id);
task_runners_.GetPlatformTaskRunner()->PostTask(
[view = platform_view_->GetWeakPtr(), loading_unit_id] {
if (view) {
view->RequestDartDeferredLibrary(loading_unit_id);
}
});
}

void Shell::ReportTimings() {
Expand Down

0 comments on commit 1b62b47

Please sign in to comment.