Skip to content

fix: memory leaks on iOS - #2782

Merged
kacperzolkiewski merged 3 commits into
software-mansion:mainfrom
kacperzolkiewski:fixFilterMemoryLeaks
Oct 8, 2025
Merged

kacperzolkiewski merged 3 commits into
software-mansion:mainfrom
kacperzolkiewski:fixFilterMemoryLeaks

Conversation

@kacperzolkiewski

@kacperzolkiewski kacperzolkiewski commented Sep 26, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes: #2687
This PR removes memory leaks from:

  • applyFilter from RNSVGFeFlood.mm
  • getMaskFromRect from RNSVGFilter.mm
  • getGlyphFont from RNSVGGlyphContext.mm
  • renderMarkers and prepareStrokeDash from RNSVGRenderable.mm

Test Plan

Run fabric-example with Xcode profiler and go through all examples. With those changes you will not see memory leaks from functions mentioned above. Without it they will appear.

Compatibility

OS Implemented
iOS ✅
MacOS ✅
Android ❌
Web ❌

Checklist

  • I have tested this on a device and a simulator
  • I added documentation in README.md
  • I updated the typed files (typescript)
  • I added a test for the API in the __tests__ folder

@kacperzolkiewski
kacperzolkiewski marked this pull request as ready for review September 26, 2025 10:41
@jakex7 jakex7 mentioned this pull request Sep 30, 2025
1 of 4 tasks
Comment thread apple/RNSVGNode.mm Resolved
Comment thread apple/RNSVGNode.mm Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory Leak When Rendering SVG with Filters on iOS and High Memory/CPU Consumption on Android

2 participants