File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/react-native/React/CoreModules Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 16
16
#import < React/RCTInvalidating.h>
17
17
#import < React/RCTUIUtils.h>
18
18
#import < React/RCTUtils.h>
19
+ #import < atomic>
19
20
20
21
#import " CoreModulesPlugins.h"
21
22
@@ -28,7 +29,7 @@ @implementation RCTDeviceInfo {
28
29
UIInterfaceOrientation _currentInterfaceOrientation;
29
30
NSDictionary *_currentInterfaceDimensions;
30
31
BOOL _isFullscreen;
31
- BOOL _invalidated;
32
+ std::atomic< BOOL > _invalidated;
32
33
}
33
34
34
35
@synthesize moduleRegistry = _moduleRegistry;
@@ -96,10 +97,9 @@ - (void)initialize
96
97
97
98
- (void )invalidate
98
99
{
99
- if (_invalidated) {
100
+ if (_invalidated. exchange ( YES ) ) {
100
101
return ;
101
102
}
102
- _invalidated = YES ;
103
103
[self _cleanupObservers ];
104
104
}
105
105
You can’t perform that action at this time.
0 commit comments