Call request on platform thread (flutter/engine#25004)

This commit is contained in:
Gary Qian
2021-03-16 14:48:01 -07:00
committed by GitHub
parent 40c0b51d5e
commit a203c370aa

View File

@@ -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() {