Skip to content

Fix a retain cycle of STHTTPRequest objects in STTwitterOAuth.#148

Merged
nst merged 1 commit into
nst:masterfrom
james-howard:FixLeak
Dec 13, 2014
Merged

Fix a retain cycle of STHTTPRequest objects in STTwitterOAuth.#148
nst merged 1 commit into
nst:masterfrom
james-howard:FixLeak

Conversation

@james-howard
Copy link
Copy Markdown
Contributor

Under ARC (and not under MRR), variables declared __block are retained
when captured in a copied block. The solution is to another __block
__weak declared variable and use that within the blocks copied by the
STHTTPRequest.

This issue is particularly bad if you're posting images, as I was,
because the image data is retained by the STHTTPRequest. So every
image post you leak the whole image data.

Under ARC (and not under MRR), variables declared __block are retained
when captured in a copied block. The solution is to another __block
__weak declared variable and use that within the blocks copied by the
STHTTPRequest.

This issue is particularly bad if you're posting images, as I was,
because the image data is retained by the STHTTPRequest. So every
image post you leak the whole image data.
nst added a commit that referenced this pull request Dec 13, 2014
Fix a retain cycle of STHTTPRequest objects in STTwitterOAuth.
@nst nst merged commit 6130f1c into nst:master Dec 13, 2014
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

Successfully merging this pull request may close these issues.

2 participants