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:
Родитель
20b4879dfd
Коммит
2a336f2b11
|
@ -136,6 +136,7 @@ public class ReactChoreographer {
|
|||
public synchronized void removeFrameCallback(
|
||||
CallbackType type,
|
||||
ChoreographerCompat.FrameCallback frameCallback) {
|
||||
synchronized (ReactChoreographer.this) {
|
||||
if (mCallbackQueues[type.getOrder()].removeFirstOccurrence(frameCallback)) {
|
||||
mTotalCallbacks--;
|
||||
maybeRemoveFrameCallback();
|
||||
|
@ -143,6 +144,7 @@ public class ReactChoreographer {
|
|||
FLog.e(ReactConstants.TAG, "Tried to remove non-existent frame callback");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void maybeRemoveFrameCallback() {
|
||||
Assertions.assertCondition(mTotalCallbacks >= 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче