Skip to content

Commit

Permalink
[0.73][Hotfix] Pick up RCTDeviceInfo fix from upstream (#2131)
Browse files Browse the repository at this point in the history
## Summary:

Pick up
facebook@44159e3#diff-4608929083e7d44679638b322e0f5297664b0106fd1ddaf39a3039af0fd3e89f
from upstream to fix a potential hang we're seeing internally.

## Test Plan:

CI should pass
  • Loading branch information
Saadnajmi authored May 25, 2024
2 parents 2f8300f + 5ae8fab commit c8d63d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/react-native/React/CoreModules/RCTDeviceInfo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ - (void)initialize

- (void)invalidate
{
if (_invalidated) {
return;
}
_invalidated = YES;
[self _cleanupObservers];
}
Expand All @@ -120,10 +123,7 @@ - (void)_cleanupObservers

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

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(invalidate)
name:RCTBridgeWillInvalidateModulesNotification
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];
}

static BOOL RCTIsIPhoneNotched()
Expand Down

0 comments on commit c8d63d0

Please sign in to comment.