Repository navigation
Commit 0941e95
authored
Fix VirtualizedSectionList._setUpdateHighlightFor deleting from wrong target (memory leak)
## Summary
Fix a typo in _setUpdateHighlightFor where the else branch (called on cell unmount to clean up) was calling:
delete this._updateHighlightFor[cellKey];
This targeted this._updateHighlightFor ## Summary
Fix a typo in _setUpdateHighlightFor where the else branch (called on cell unmount to clean up) was calling:
delete this._updateHighlightFor[cellKey];
This targeted this._updateHighlightFor - the arrow function method itself - rather than this._updateHighlightMap, the backing store object. The FlowFixMe suppression comment was silencing the resulting Flow type error.
Fix:
delete this._updateHighlightMap[cellKey];
## Impact
- Memory leak: highlight callbacks accumulated in _updateHighlightMap and were never removed on unmount
- - Stale callbacks: could trigger highlight state updates on cells that no longer exist
- - The sibling method _setUpdatePropsFor always had the correct pattern
## Test Plan
- Existing separator highlight tests cover this code path
- - Typo fix restoring originally intended behavior
## Changelog
[General] [Fixed] - Fix VirtualizedSectionList._setUpdateHighlightFor deleting from wrong target (memory leak)
Differential Revision: D127652888
Pull Request resolved: #594551 parent f50b8b1 commit 0941e95
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
435 | | - | |
| 434 | + | |
436 | 435 | | |
437 | 436 | | |
438 | 437 | | |
| |||
0 commit comments