Skip to content

Commit e7e7ca1

Browse files
Always initialize the _weakFactory in FlutterViewController (flutter#32395)
Fixes flutter#101209
1 parent 5bf8acd commit e7e7ca1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shell/platform/darwin/ios/framework/Source/FlutterViewController.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ - (void)sharedSetupWithProject:(nullable FlutterDartProject*)project
195195
project = [[[FlutterDartProject alloc] init] autorelease];
196196
}
197197
FlutterView.forceSoftwareRendering = project.settings.enable_software_rendering;
198+
_weakFactory = std::make_unique<fml::WeakPtrFactory<FlutterViewController>>(self);
198199
auto engine = fml::scoped_nsobject<FlutterEngine>{[[FlutterEngine alloc]
199200
initWithName:@"io.flutter"
200201
project:project
@@ -206,7 +207,6 @@ - (void)sharedSetupWithProject:(nullable FlutterDartProject*)project
206207
}
207208

208209
_viewOpaque = YES;
209-
_weakFactory = std::make_unique<fml::WeakPtrFactory<FlutterViewController>>(self);
210210
_engine = std::move(engine);
211211
_flutterView.reset([[FlutterView alloc] initWithDelegate:_engine opaque:self.isViewOpaque]);
212212
[_engine.get() createShell:nil libraryURI:nil initialRoute:initialRoute];

0 commit comments

Comments
 (0)