Fix wrong variable in VirtualizedSectionList highlight callback cleanup#56384
Conversation
_setUpdateHighlightFor deletes from this._updateHighlightFor (a method) instead of this._updateHighlightMap (the actual map). This means highlight callbacks are never cleaned up when cells are removed, causing a memory leak. The $FlowFixMe annotation was masking the type error.
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
d35383c to
c2ebc21
Compare
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
Fix a bug in
_setUpdateHighlightForwhere the cleanup path deletes fromthis._updateHighlightFor(which is a method) instead ofthis._updateHighlightMap(the actual map storing highlight callbacks).This means highlight callbacks were never cleaned up when cells were removed, causing a memory leak. The
$FlowFixMe[prop-missing]annotation was masking what Flow correctly identified as a type error.For reference, the parallel method
_setUpdatePropsForat line 441 correctly usesthis._updatePropsMapfor its cleanup path.Changelog:
[GENERAL] [FIXED] - Fix highlight callback cleanup in VirtualizedSectionList using wrong variable name
Test Plan
SectionListwith separator highlight support_updateHighlightMap_updateHighlightForwas a no-op, so callbacks accumulated