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

garbage in GCDMulticastDelegate.removeDelegate while delegate's dealloc #490

Open
Sega-Zero opened this issue Jan 27, 2015 · 3 comments
Open

Comments

@Sega-Zero
Copy link

if I call removeDelegate from subscriber's dealloc, the node object stays in nodeDelegates array, because weak references has been already nulled, but the object is still alive. This leads to a garbage in nodeDelegates list, because this code in removeDelegate:delegateQueue::

    if (delegate == nodeDelegate)

is never YES in that case (nodeDelegate ==nil). So I had to expand it into this code:

    if (delegate == nodeDelegate || !nodeDelegate)

This will cleanup the list of the dead nodes.

@mdsb100
Copy link

mdsb100 commented Jun 15, 2016

+1

@CheckRan
Copy link

  • 1 ,help, I need this! Is NULL when subscriber's dealloc!

@CheckRan
Copy link

@robbiehanson

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

3 participants