react-native-svg
react-native-svg copied to clipboard
Fix memory leak of a CGPathRef
Summary
Regarding issue #1385 Fixes memory leak of a CGPathRef.
Explain the motivation for making this change: here are some points to help you:
CGPath leaks listed in Xcode:

Backtrace of leaked object, identifying RNSVGUse as the object that leaked the CGPathRef:

-
What issues does the pull request solve? Please tag them so that they will get automatically closed once the PR is merged Issue #1385
-
What is the feature? (if applicable) Memory leak fix
-
How did you implement the solution? Added a call to autorelease returned CGPathRef in line with the other implementations of
getPath:
-
What areas of the library does it impact?
Test Plan
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
What's required for testing (prerequisites)?
Running an app that uses react-native-svg in the Xcode debugger with malloc stack tracing enabled.
What are the steps to reproduce (after prerequisites)?
Halt the app in the debugger and examine memory graph, specifically the leaked objects filter (by clicking on the blue triangle icon)

Compatibility
OS | Implemented |
---|---|
iOS | ✅ |
Android | ❌ |
Checklist
- [x] 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
Would be awesome if this could get merged. We are also experiencing this issue. Looks like a simple fix?
I'd love to remove my local patch for this fix. Any idea when this will make it into a release?
@javache hi, is there any reason why this is not merged yet? Thanks
Hi, Could someone explain how we can reproduce that nowadays? We want to reproduce that memory leak. Thank you.