Closed fbarbat closed 2 years ago
I just realized LDSwiftEventSource
is on a dependent project and that there was a PR to fix it there https://github.com/launchdarkly/swift-eventsource/pull/23/files. Leaving this issue open because it needs to be fixed there but also the dependency needs to be updated here.
Hi @fbarbat,
Thanks for filing this issue. We're actively evaluating the PR in the swift-eventsource
repo now and should have it merged (or a similar fix) and released soon.
I agree that leaving this issue open until the SDK has published a version dependent on a version of LDSwiftEventSource
with the fix makes sense.
Thanks, @gwhelanLD
Hi @fbarbat,
The https://github.com/launchdarkly/ios-client-sdk/releases/tag/5.4.4 is now available and should resolve this leak. Thanks for pointing out this issue and contributing towards a fix for LDSwiftEventSource
.
Thanks, @gwhelanLD
Is this a support request? No
Describe the bug Memory leak on
LDSwiftEventSource
when LD reconnectsTo reproduce 1 - Start from Xcode a macOS app that uses LD 2 - Pause on a breakpoint for some minutes so LD connection to server side is lost 3 - Resume the execution. LD will try to reconnect by calling![Screen Shot 2021-10-12 at 19 20 51](https://user-images.githubusercontent.com/857775/137037646-114ff270-37a8-4a4f-998e-83443920417e.png)
LDSwiftEventSource.connect
4 - Inspect the memory 5 - There will be many leaked objects and if you navigate back to the source objects retaining them you will see:Expected behavior When using the memory inspector, there shouldn't be any memory leaks that point to LD retain cycle. The ConnectionHandler created in
LDSwiftEventSource.connect
shouldn't retain self.Logs .
SDK version 5.4.3
Language version, developer tools Xcode 13, Swift
OS/platform macOS
Additional context Note this is a macOS app using this SDK.