GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
We are using the wax in a project feed reader, as it does recursive HTTP requests (an average of 12 every 10 minutes), we shall find a memory leak in code wax.http.request.
The problem happens due to a quirk in the way NSURLConnection performs asynchronous requests. Briefly, the problem happens because of an extra retain it makes when it receives a message like: initWithRequest:delegate:startImmediately, as it needs to retain the delegate for the future answer this ends up confusing the gc of the wax.
A temporary solution was to execute a release in properties of wax_http_request class: nuxlli/wax@5dbff70
This solution does not solve the whole problem, as an instance of wax_http_request still gets lost, but in our case has saved a lot of memory.
I believe in a refactory wax_http_request, so that the delegate is not the class itself, would be the best solution.
What do you think?
Gah! NSURLConnection delegates and their memory management always fool me! This looks like a good temp fix.
A refactor is definitely in order. I'll take a look at reproducing the bug and trying to get a fix in.