Skip to content
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

Closed
lyricsboy opened this issue Jul 10, 2015 · 3 comments
Closed

Memory leak of stream objects #98

lyricsboy opened this issue Jul 10, 2015 · 3 comments

Comments

@lyricsboy
Copy link

The socket stream pair is created in WebSocket#initStreamsWithData using CFStreamCreatePairWithSocketToHost, 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.

@daltoniam
Copy link
Owner

Ah, very true. Totally forgot to change those, thank you for pointing that out. I will update that shortly.

@daltoniam
Copy link
Owner

Resolved in master. I will create a new tag and release shortly. Thanks again!

@daltoniam
Copy link
Owner

Tag 0.9.4 has been released with the fix.

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

No branches or pull requests

2 participants