diff --git a/engine/src/flutter/shell/platform/darwin/desktop/flutter_window.mm b/engine/src/flutter/shell/platform/darwin/desktop/flutter_window.mm index 683bf4a3668..912a32ff6e2 100644 --- a/engine/src/flutter/shell/platform/darwin/desktop/flutter_window.mm +++ b/engine/src/flutter/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()));