提交 a64921e3 编写于 作者: J Jason Simmons 提交者: GitHub

Hold the TestRunner's platform view through a shared_ptr (#3870)

flutter_tester was throwing a bad_weak_ptr while setting up the engine
because the PlatformViewTest was held in a unique_ptr
上级 63bf1d28
......@@ -13,7 +13,7 @@
namespace shell {
TestRunner::TestRunner() : platform_view_(std::make_unique<PlatformViewTest>()) {
TestRunner::TestRunner() : platform_view_(std::make_shared<PlatformViewTest>()) {
platform_view_->Attach();
blink::ViewportMetrics metrics;
metrics.device_pixel_ratio = 3.0;
......
......@@ -32,7 +32,7 @@ class TestRunner {
TestRunner();
~TestRunner();
std::unique_ptr<PlatformView> platform_view_;
std::shared_ptr<PlatformView> platform_view_;
FTL_DISALLOW_COPY_AND_ASSIGN(TestRunner);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册