提交 d098b358 编写于 作者: C Chinmay Garde 提交者: GitHub

Fix Mac desktop platform for use with std::weak_ptr in the PlatformView. (#3897)

上级 de00757d
...@@ -37,7 +37,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh ...@@ -37,7 +37,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh
} }
@implementation FlutterWindow { @implementation FlutterWindow {
std::unique_ptr<shell::PlatformViewMac> _platformView; std::shared_ptr<shell::PlatformViewMac> _platformView;
bool _mouseIsDown; bool _mouseIsDown;
} }
...@@ -55,7 +55,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh ...@@ -55,7 +55,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh
- (void)setupPlatformView { - (void)setupPlatformView {
FTL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; FTL_DCHECK(_platformView == nullptr) << "The platform view must not already be set.";
_platformView.reset(new shell::PlatformViewMac(self.renderSurface)); _platformView = std::make_shared<shell::PlatformViewMac>(self.renderSurface);
_platformView->Attach(); _platformView->Attach();
_platformView->SetupResourceContextOnIOThread(); _platformView->SetupResourceContextOnIOThread();
_platformView->NotifyCreated(std::make_unique<shell::GPUSurfaceGL>(_platformView.get())); _platformView->NotifyCreated(std::make_unique<shell::GPUSurfaceGL>(_platformView.get()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册