From d098b358b42b968f91f8ffb6e066af38622493aa Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 18 Jul 2017 14:29:36 -0700 Subject: [PATCH] Fix Mac desktop platform for use with std::weak_ptr in the PlatformView. (#3897) --- shell/platform/darwin/desktop/flutter_window.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index 683bf4a36..912a32ff6 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -37,7 +37,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh } @implementation FlutterWindow { - std::unique_ptr _platformView; + std::shared_ptr _platformView; bool _mouseIsDown; } @@ -55,7 +55,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh - (void)setupPlatformView { FTL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; - _platformView.reset(new shell::PlatformViewMac(self.renderSurface)); + _platformView = std::make_shared(self.renderSurface); _platformView->Attach(); _platformView->SetupResourceContextOnIOThread(); _platformView->NotifyCreated(std::make_unique(_platformView.get())); -- GitLab