File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react-native/ReactCommon/react/renderer/componentregistry Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,6 @@ void ComponentDescriptorRegistry::add(
9292
9393void ComponentDescriptorRegistry::registerComponentDescriptor (
9494 const SharedComponentDescriptor& componentDescriptor) const {
95- std::unique_lock lock (mutex_);
96-
9795 ComponentHandle componentHandle = componentDescriptor->getComponentHandle ();
9896 _registryByHandle[componentHandle] = componentDescriptor;
9997
@@ -126,9 +124,12 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at(
126124 }
127125
128126 if (it == _registryByName.end ()) {
127+ lock.unlock ();
129128 auto componentDescriptor = std::make_shared<
130129 const UnstableLegacyViewManagerAutomaticComponentDescriptor>(
131130 parameters_, unifiedComponentName);
131+
132+ std::unique_lock writeLock (mutex_);
132133 registerComponentDescriptor (componentDescriptor);
133134 return *_registryByName.find (unifiedComponentName)->second ;
134135 }
@@ -166,6 +167,7 @@ bool ComponentDescriptorRegistry::hasComponentDescriptorAt(
166167
167168void ComponentDescriptorRegistry::setFallbackComponentDescriptor (
168169 const SharedComponentDescriptor& descriptor) {
170+ std::unique_lock lock (mutex_);
169171 _fallbackComponentDescriptor = descriptor;
170172 registerComponentDescriptor (descriptor);
171173}
You can’t perform that action at this time.
0 commit comments