File tree Expand file tree Collapse file tree
packages/react-native/ReactCommon/react/renderer/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,11 +134,19 @@ void EventEmitter::dispatchEvent(
134134 return ;
135135 }
136136
137+ SharedEventTarget eventTarget;
138+ std::weak_ptr<const ShadowNodeFamily> shadowNodeFamily;
139+ {
140+ std::scoped_lock lock (DispatchMutex ());
141+ eventTarget = eventTarget_;
142+ shadowNodeFamily = shadowNodeFamily_;
143+ }
144+
137145 eventDispatcher->dispatchEvent (RawEvent (
138146 normalizeEventType (std::move (type)),
139147 std::move (payload),
140- eventTarget_ ,
141- shadowNodeFamily_ ,
148+ std::move (eventTarget) ,
149+ std::move (shadowNodeFamily) ,
142150 category,
143151 false ,
144152 eventTimestamp));
@@ -180,11 +188,19 @@ void EventEmitter::dispatchUniqueEvent(
180188 return ;
181189 }
182190
191+ SharedEventTarget eventTarget;
192+ std::weak_ptr<const ShadowNodeFamily> shadowNodeFamily;
193+ {
194+ std::scoped_lock lock (DispatchMutex ());
195+ eventTarget = eventTarget_;
196+ shadowNodeFamily = shadowNodeFamily_;
197+ }
198+
183199 eventDispatcher->dispatchUniqueEvent (RawEvent (
184200 normalizeEventType (std::move (type)),
185201 std::move (payload),
186- eventTarget_ ,
187- shadowNodeFamily_ ,
202+ std::move (eventTarget) ,
203+ std::move (shadowNodeFamily) ,
188204 RawEvent::Category::Continuous,
189205 true ,
190206 eventTimestamp));
You can’t perform that action at this time.
0 commit comments