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

Change delegates to weak references #21

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Conversation

robhor
Copy link
Contributor

@robhor robhor commented Apr 7, 2016

SpotlightViewController contained a strong reference to a SpotlightTransitionController, which in turn had a strong reference to the SpotlightViewController through the delegate variable.
This caused a reference cycle that prevented SpotlightViewControllers from being deallocated, leaking memory.

By changing the delegate variable in SpotlightTransitionControllerDelegate to a weak variable, this retain cycle is prevented. I changed the delegate in SpotlightViewControllerDelegate to a weak variable as well, as this is common practice for delegates.

@xai3
Copy link
Collaborator

xai3 commented Apr 12, 2016

@robhor I was careless... thx!

@xai3 xai3 merged commit 8baee64 into bannzai:master Apr 12, 2016
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