Skip to content

Commit 70b5eb3

Browse files
excedfacebook-github-bot
authored andcommittedOct 16, 2018
ListView requestAnimationFrame leak (#21802)
Summary: Related to #21488 Disclaimer: I made this PR. I think there's some requestAnimationFrame events that are not cleared on unmount because of bad use of `splice` method. - All flow tests succeed. - RNTester: iOS (this change should only affect iOS because calculateChildFrames is iOS only) Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate. - TODO: I'll write a load test for ListView [GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin Pull Request resolved: #21802 Differential Revision: D10391812 Pulled By: RSNara fbshipit-source-id: 49f0b0a4641ec29bcb4cc04bd3bafb42b3842b69
1 parent 8a3a0ad commit 70b5eb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Libraries/Lists/ListView/ListView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ const ListView = createReactClass({
544544

545545
_requestAnimationFrame: function(fn: () => void): void {
546546
const rafId = requestAnimationFrame(() => {
547-
this._rafIds.splice(this._rafIds.indexOf(rafId));
547+
this._rafIds = this._rafIds.filter(id => id !== rafId);
548548
fn();
549549
});
550550
this._rafIds.push(rafId);

0 commit comments

Comments
 (0)
Please sign in to comment.