-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak of stream objects #98
Comments
Ah, very true. Totally forgot to change those, thank you for pointing that out. I will update that shortly. |
Resolved in master. I will create a new tag and release shortly. Thanks again! |
Tag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The socket stream pair is created in
WebSocket#initStreamsWithData
usingCFStreamCreatePairWithSocketToHost
, which sets the stream arguments to objects following the "create rule" (i.e. retained values).The code subsequently calls
takeUnretainedValue()
on them which creates an unbalanced retain (memory leak).Calling
takeRetainedValue()
instead is the correct approach. You can verify the leak (and the fix) using the Allocations Instrument to track allocations matching "stream" and explicitly disconnecting the socket.The text was updated successfully, but these errors were encountered: