Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(frame): improve weakref guards #9518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2021
Merged
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
8 changes: 4 additions & 4 deletions packages/core/ui/frame/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ class UINavigationControllerImpl extends UINavigationController {
}

get owner(): Frame {
return this._owner.get();
return this._owner.get?.();
}

@profile
public viewWillAppear(animated: boolean): void {
super.viewWillAppear(animated);
const owner = this._owner.get();
const owner = this._owner.get?.();
if (owner && !owner.isLoaded && !owner.parent) {
owner.callLoaded();
}
Expand All @@ -419,7 +419,7 @@ class UINavigationControllerImpl extends UINavigationController {
@profile
public viewDidDisappear(animated: boolean): void {
super.viewDidDisappear(animated);
const owner = this._owner.get();
const owner = this._owner.get?.();
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
owner.callUnloaded();
owner._tearDownUI(true);
Expand Down Expand Up @@ -543,7 +543,7 @@ class UINavigationControllerImpl extends UINavigationController {
super.traitCollectionDidChange(previousTraitCollection);

if (majorVersion >= 13) {
const owner = this._owner.get();
const owner = this._owner.get?.();
if (owner && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) {
owner.notify({
eventName: IOSHelper.traitCollectionColorAppearanceChangedEvent,
Expand Down