mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-25 21:05:40 +08:00
Fabric: Simplified relationship between RawEvent and EventEmitter
Summary: Instead of relying on explicit `RawEventDispatchable` function, we simply check the existence of the `weak_ptr` to `EventTarget`. This is efficient and sufficient because only an EventEmitter retains an associated EventTarget. Reviewed By: mdvacca Differential Revision: D9764858 fbshipit-source-id: 4ac25d925f189d0f8b9002e52388fd51629934a8
This commit is contained in:
committed by
Facebook Github Bot
parent
b6e42517e5
commit
93dd790cad
@@ -39,10 +39,10 @@ void EventQueue::onBeat() const {
|
||||
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(EventEmitter::DispatchMutex());
|
||||
|
||||
for (const auto &event : queue) {
|
||||
auto eventTarget = event.eventTarget.lock();
|
||||
eventPipe_(
|
||||
eventTarget && event.isDispatchable() ? eventTarget.get() : nullptr,
|
||||
event.eventTarget.lock().get(),
|
||||
event.type,
|
||||
event.payload
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user