Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Set the ivar to nil after release it in dealloc method. #38737

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,27 @@ - (void)dealloc {
}];

[_labelPrefix release];
_labelPrefix = nil;
[_initialRoute release];
_initialRoute = nil;
[_pluginPublications release];
_pluginPublications = nil;
[_registrars release];
_registrars = nil;
_binaryMessenger.parent = nil;
_textureRegistry.parent = nil;
[_binaryMessenger release];
_binaryMessenger = nil;
[_textureRegistry release];
_textureRegistry = nil;
[_isolateId release];
_isolateId = nil;

NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
if (_flutterViewControllerWillDeallocObserver) {
[center removeObserver:_flutterViewControllerWillDeallocObserver];
[_flutterViewControllerWillDeallocObserver release];
_flutterViewControllerWillDeallocObserver = nil;
}
[center removeObserver:self];

Expand Down