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

ASCollectionNode & ASTableNode dealloc failing Main Thread Checker #804

Closed
johntmcintosh opened this issue Feb 13, 2018 · 2 comments
Closed

Comments

@johntmcintosh
Copy link
Contributor

#793 introduced a new implementation of dealloc to ASCollectionNode and ASTableNode which asserts that the view's superview must be nil.

- (void)dealloc
{
  if ([self isNodeLoaded]) {
    ASDisplayNodeAssert(self.view.superview == nil, @"Node's view should be removed from hierarchy.");
  }
}

However, I'm now seeing in my application that the main thread checker is failing when I deallocate an ASCollectionNode because dealloc is being called on a background thread:

-[UIView superview] must be used from main thread only

Looking at the stacktrace I get when in dealloc, it looks like ASDisplayNode's dealloc is explicitly handling the fact that it may be called off the main thread, so I suspect that's something that needs to be accounted for in ASCollectionNode and ASTableNode as well.

I'm not sure whether the right fix is not having the assertion, or doing something else to move the deallocation to the main thread.

@nguyenhuy
Copy link
Member

Hi there, thanks for reporting. #803 should fix this issue. Please let us know otherwise!

@johntmcintosh
Copy link
Contributor Author

Thanks @nguyenhuy ! I've confirmed this is resolved for me in the latest on master. Closing out.

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

2 participants