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

Expose HTTPNetworkDelegate publicly as weak var #990

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

designatednerd
Copy link
Contributor

Had a good discussion in Spectrum about why this was set as an internal let rather than a public weak var, which would allow the delegate to be set after initialization.

Having dug back through the history of the code, there really wasn't a good reason not to do it that way, so I've gone ahead and made the change.

This is a potentially breaking change - in theory switching this to a weak var mostly helps prevent retain cycles, but if you weren't holding on to the delegate already, this could theoretically result in the delegate getting autoreleased in places it wasn't before.

@designatednerd designatednerd added this to the 0.22.0 milestone Feb 3, 2020
@designatednerd designatednerd merged commit 67b1a4f into master Feb 3, 2020
@designatednerd designatednerd deleted the weak-delegate branch February 4, 2020 19:03
@RolandasRazma
Copy link
Contributor

@designatednerd as this is silently breaking change I think you should remove delegate from init so people would realise that something is changed and double check that they retain delegate

@designatednerd
Copy link
Contributor Author

🤔Hmm - let me think on that, but interesting suggestion

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