Repository navigation
fix(interaction): reuse and release series brush clip paths - #8575
Merged
Merged
Conversation
Member
|
@dvd233 Does this problem cause a memory leak? |
Contributor
Author
|
Yes: the obsolete clipping rectangles remain attached to the scenegraph and accumulate with brush updates, so they stay reachable after the brush is removed. In the recorded browser reproduction, a 20-step drag left 21 rectangles after removal. With this branch, there is one active rectangle and none after removal or interaction destruction. I did not perform heap profiling or measure leaked bytes, so the evidence is retained scenegraph objects rather than a quantified heap-growth claim. The five lifecycle regression tests and before/after browser checks described in the PR cover this behavior. |
lxfu1
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
npm testpasses (see the Windows validation note below; upstream CI pending)Description of change
With
brushHighlight: { series: true }, every brush update appends a new shared clipping rectangle. Replacing the clones' clip path leaves earlier rectangles attached to the plot, and removing the brush or destroying the interaction does not release them.Reuse one shared rectangle while the brush is active and release it through the existing cleanup path. Add five integration cases covering repeated moves, reverse brushing, removal, interaction destruction, and ordinary element brushing. Update six focus/context snapshots to remove only obsolete clipping rectangles; visible geometry and the active clipping region remain unchanged.
Validation:
Windows validation note: SVGO emits CRLF on Windows while the repository SVG goldens use LF. Full-suite validation therefore temporarily sets its supported
js2svg.eol: 'lf'serializer option, without changing test selection, assertions, timeouts, or coverage. The helper is restored afterward, and this local option is not part of the PR.