mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix Mac desktop platform for use with std::weak_ptr in the PlatformView. (flutter/engine#3897)
This commit is contained in:
parent
1a126078de
commit
9dbdc4bee6
@ -37,7 +37,7 @@ static inline blink::PointerData::Change PointerChangeFromNSEventPhase(NSEventPh
|
||||
}
|
||||
|
||||
@implementation FlutterWindow {
|
||||
std::unique_ptr<shell::PlatformViewMac> _platformView;
|
||||
std::shared_ptr<shell::PlatformViewMac> _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<shell::PlatformViewMac>(self.renderSurface);
|
||||
_platformView->Attach();
|
||||
_platformView->SetupResourceContextOnIOThread();
|
||||
_platformView->NotifyCreated(std::make_unique<shell::GPUSurfaceGL>(_platformView.get()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user