Skip to content

Commit

Permalink
Added a log message when sharing a FlutterEngine across multiple Flut…
Browse files Browse the repository at this point in the history
…terViewControllers. (flutter#17186)
  • Loading branch information
gaaclarke committed Mar 23, 2020
1 parent 11f5521 commit 8a8b298
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ - (instancetype)initWithEngine:(FlutterEngine*)engine
self = [super initWithNibName:nibName bundle:nibBundle];
if (self) {
_viewOpaque = YES;
if (engine.viewController) {
FML_LOG(ERROR) << "The supplied FlutterEngine " << [[engine description] UTF8String]
<< " is already used with FlutterViewController instance "
<< [[engine.viewController description] UTF8String]
<< ". One instance of the FlutterEngine can only be attached to one "
"FlutterViewController at a time. Set FlutterEngine.viewController "
"to nil before attaching it to another FlutterViewController.";
}
_engine.reset([engine retain]);
_engineNeedsLaunch = NO;
_flutterView.reset([[FlutterView alloc] initWithDelegate:_engine opaque:self.isViewOpaque]);
Expand Down

0 comments on commit 8a8b298

Please sign in to comment.