mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix crash when accessing _viewRegistry
Summary: Changelog: [internal] Fixes fabric specific crash `_viewRegistry` is not thread safe and accessing it on another thread can cause a crash. Calling it inside `RCTUnsafeExecuteOnMainQueueSync` shouldn't degrade performance because it is only used as a fallback. Changelog: [Internal] Reviewed By: rickhanlonii Differential Revision: D18421789 fbshipit-source-id: 2adff434afe0a3c19318c95b051ee91ccf6293e5
This commit is contained in:
committed by
Facebook Github Bot
parent
58726cee85
commit
620f83aae5
@@ -335,7 +335,10 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
|
||||
return name;
|
||||
}
|
||||
|
||||
UIView *view = _viewRegistry[reactTag];
|
||||
__block UIView *view;
|
||||
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||
view = self->_viewRegistry[reactTag];
|
||||
});
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wundeclared-selector"
|
||||
|
||||
Reference in New Issue
Block a user