Skip to content

Commit

Permalink
Don't pass on receiveEvent after CatalystInstance destruction
Browse files Browse the repository at this point in the history
Summary:
It is possible for receiveEvent to be called concurrently with/after destruction of FabricUIManager. Drop events if we are able to detect that case.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D29596271

fbshipit-source-id: 1fa50d9c3cff0bf578316d905966e1bdfffe94d1
JoshuaGross authored and facebook-github-bot committed Jul 8, 2021
1 parent 771d584 commit 8ed4068
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -820,6 +820,11 @@ public void receiveEvent(
FLog.d(TAG, "Emitted event without surfaceId: [%d] %s", reactTag, eventName);
}

if (mDestroyed) {
FLog.e(TAG, "Attempted to receiveEvent after destruction");
return;
}

EventEmitterWrapper eventEmitter = mMountingManager.getEventEmitter(surfaceId, reactTag);

if (eventEmitter == null) {

0 comments on commit 8ed4068

Please sign in to comment.