Skip to content

Commit

Permalink
remove incorrect call of removeObserver from RCTDeviceInfo
Browse files Browse the repository at this point in the history
Summary:
changelog: [internal]


in recent commit, facebook@470bc40, use of KVO was removed. 
But `removeObserver` when `addObserver` was not called leads to a crash and must be removed as well.

Differential Revision: D69918158
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Feb 20, 2025
1 parent 3ab568d commit 52c9da4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/react-native/React/CoreModules/RCTDeviceInfo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ - (void)_cleanupObservers

[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];

[RCTKeyWindow() removeObserver:self forKeyPath:kFrameKeyPath];

#if TARGET_OS_IOS
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
#endif
Expand Down

0 comments on commit 52c9da4

Please sign in to comment.