mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix: avoid calling Timing.deleteTimer for setImmediate and requestIdleCallback (#26113)
Summary: Fix a simple error where `types[index]` was being accessed after it was cleared, instead of before. ## Changelog [iOS] [Fixed] - never call deleteTimer for setImmediate and requestIdleCallback Pull Request resolved: https://github.com/facebook/react-native/pull/26113 Test Plan: None Differential Revision: D17314489 Pulled By: cpojer fbshipit-source-id: 74715f0f7cc2d5cee3b97a67313c5e96e9d6c555
This commit is contained in:
committed by
Facebook Github Bot
parent
796b3a1f88
commit
4fc3e7ae71
@@ -218,8 +218,8 @@ function _freeCallback(timerID: number) {
|
||||
const index = timerIDs.indexOf(timerID);
|
||||
// See corresponding comment in `callTimers` for reasoning behind this
|
||||
if (index !== -1) {
|
||||
_clearIndex(index);
|
||||
const type = types[index];
|
||||
_clearIndex(index);
|
||||
if (type !== 'setImmediate' && type !== 'requestIdleCallback') {
|
||||
deleteTimer(timerID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user