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,11 +136,13 @@ public class ReactChoreographer {
|
||||||
public synchronized void removeFrameCallback(
|
public synchronized void removeFrameCallback(
|
||||||
CallbackType type,
|
CallbackType type,
|
||||||
ChoreographerCompat.FrameCallback frameCallback) {
|
ChoreographerCompat.FrameCallback frameCallback) {
|
||||||
if (mCallbackQueues[type.getOrder()].removeFirstOccurrence(frameCallback)) {
|
synchronized (ReactChoreographer.this) {
|
||||||
mTotalCallbacks--;
|
if (mCallbackQueues[type.getOrder()].removeFirstOccurrence(frameCallback)) {
|
||||||
maybeRemoveFrameCallback();
|
mTotalCallbacks--;
|
||||||
} else {
|
maybeRemoveFrameCallback();
|
||||||
FLog.e(ReactConstants.TAG, "Tried to remove non-existent frame callback");
|
} else {
|
||||||
|
FLog.e(ReactConstants.TAG, "Tried to remove non-existent frame callback");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче