未验证 提交 f6ea8f32 编写于 作者: A Alexander Aprelev 提交者: GitHub

Fix windows build by using lambda capture workaround (#4514)

* Fix windows build by using lambda capture workaround

* clang format, add todo

* clang-format again
上级 6bacf452
......@@ -331,27 +331,33 @@ void Shell::SetAssetBundlePathInPlatformViewUIThread(
*view_existed = false;
IteratePlatformViews([
view_id, // argument
assets_directory = std::move(assets_directory), // argument
&view_existed, // out
&dart_isolate_id, // out
&isolate_name // out
](PlatformView * view)
->bool {
if (reinterpret_cast<uintptr_t>(view) != view_id) {
// Keep looking.
return true;
}
*view_existed = true;
view->SetAssetBundlePath(assets_directory);
*dart_isolate_id =
view->engine().GetUIIsolateMainPort();
*isolate_name = view->engine().GetUIIsolateName();
// We found the requested view. Stop iterating over
// platform views.
return false;
});
IteratePlatformViews(
[view_id, // argument
#if !defined(OS_WIN)
// Using std::move on const references inside lambda capture is
// not supported on Windows for some reason.
// TODO(https://github.com/flutter/flutter/issues/13908):
// Investigate the root cause of the difference.
assets_directory = std::move(assets_directory), // argument
#else
assets_directory, // argument
#endif
&view_existed, // out
&dart_isolate_id, // out
&isolate_name // out
](PlatformView* view) -> bool {
if (reinterpret_cast<uintptr_t>(view) != view_id) {
// Keep looking.
return true;
}
*view_existed = true;
view->SetAssetBundlePath(assets_directory);
*dart_isolate_id = view->engine().GetUIIsolateMainPort();
*isolate_name = view->engine().GetUIIsolateName();
// We found the requested view. Stop iterating over
// platform views.
return false;
});
latch->Signal();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册