Skip to content

Commit ac3c895

Browse files
author
Hristo Hristov
authored
Fix crash on iOS (NativeScript#5071)
* Fix crash on iOS where JS object that extend NSObject was not hold into memory. * TS fix
1 parent 725475f commit ac3c895

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tns-core-modules/ui/frame/frame.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class NotificationObserver2 extends NSObject {
3838
};
3939
}
4040

41-
const observer = NotificationObserver2.initWithCallback(handleNotification);
41+
export const __observer = NotificationObserver2.initWithCallback(handleNotification);
4242
const notificationCenter = utils.ios.getter(NSNotificationCenter, NSNotificationCenter.defaultCenter);
43-
notificationCenter.addObserverSelectorNameObject(observer, "onReceive", UIApplicationDidChangeStatusBarFrameNotification, null);
43+
notificationCenter.addObserverSelectorNameObject(__observer, "onReceive", UIApplicationDidChangeStatusBarFrameNotification, null);
4444

4545
function handleNotification(notification: NSNotification): void {
4646
// When there is a 40px high "in-call" status bar, nobody moves the navigationBar top from 20 to 40 and it remains underneath the status bar.

0 commit comments

Comments
 (0)