Skip to content

Commit

Permalink
Always initialize the _weakFactory in FlutterViewController (flutter#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons committed Apr 4, 2022
1 parent 5bf8acd commit e7e7ca1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ - (void)sharedSetupWithProject:(nullable FlutterDartProject*)project
project = [[[FlutterDartProject alloc] init] autorelease];
}
FlutterView.forceSoftwareRendering = project.settings.enable_software_rendering;
_weakFactory = std::make_unique<fml::WeakPtrFactory<FlutterViewController>>(self);
auto engine = fml::scoped_nsobject<FlutterEngine>{[[FlutterEngine alloc]
initWithName:@"io.flutter"
project:project
Expand All @@ -206,7 +207,6 @@ - (void)sharedSetupWithProject:(nullable FlutterDartProject*)project
}

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

0 comments on commit e7e7ca1

Please sign in to comment.