mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix NoSuchElementException in ReactChoreographerDispatcher.doFrame
Summary: This diff fixes a NoSuchElementException that was being thrown at ReactChoreographerDispatcher.doFrame(). The root cause was a lack of syncronization in removeFrameCallback(). Reviewed By: shergin Differential Revision: D14619386 fbshipit-source-id: 80bc9e44866218d2a8703b3186f6958c145f260b
This commit is contained in:
committed by
Facebook Github Bot
parent
20b4879dfd
commit
2a336f2b11
@@ -136,11 +136,13 @@ public class ReactChoreographer {
|
||||
public synchronized void removeFrameCallback(
|
||||
CallbackType type,
|
||||
ChoreographerCompat.FrameCallback frameCallback) {
|
||||
if (mCallbackQueues[type.getOrder()].removeFirstOccurrence(frameCallback)) {
|
||||
mTotalCallbacks--;
|
||||
maybeRemoveFrameCallback();
|
||||
} else {
|
||||
FLog.e(ReactConstants.TAG, "Tried to remove non-existent frame callback");
|
||||
synchronized (ReactChoreographer.this) {
|
||||
if (mCallbackQueues[type.getOrder()].removeFirstOccurrence(frameCallback)) {
|
||||
mTotalCallbacks--;
|
||||
maybeRemoveFrameCallback();
|
||||
} else {
|
||||
FLog.e(ReactConstants.TAG, "Tried to remove non-existent frame callback");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user