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

Strong reference to PlayerDelegate is not good #47

Closed
prcela opened this issue Dec 7, 2015 · 1 comment
Closed

Strong reference to PlayerDelegate is not good #47

prcela opened this issue Dec 7, 2015 · 1 comment

Comments

@prcela
Copy link

prcela commented Dec 7, 2015

I have a view controller on navigation stack. That view controller has a player and it is set as a PlayerDelegate. When view controller is removed from stack it is not deinitialized because player holds a strong reference to his delegate.

You should change your code to this:

public weak var delegate: PlayerDelegate?

public protocol PlayerDelegate: class {
...
}

ghost pushed a commit that referenced this issue Dec 13, 2015
@ghost
Copy link

ghost commented Dec 13, 2015

commit b4d4a4a
Author: Leslie Nadeau leslienadeau@gmail.com
Date: Sat Dec 12 23:25:59 2015 -0800

re-define delegate as weak
https://github.com/piemonte/Player/issues/47

thx @prcela

@ghost ghost closed this as completed Dec 13, 2015
This issue was closed.
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

1 participant