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

observer leak #222

Open
bestwnh opened this issue Sep 28, 2014 · 0 comments
Open

observer leak #222

bestwnh opened this issue Sep 28, 2014 · 0 comments

Comments

@bestwnh
Copy link

bestwnh commented Sep 28, 2014

I just use the PullToRefresh and InfiniteScrolling just like normal in code. But in one of my view controller the Xcode tell me the observer not remove when the scrollview dealloc. It not crash but may make a leak. And all other view controller is working so good. It's weird.

But I finally find the issue.:tada::tada::tada:
When I set the
showsInfiniteScrolling = YES or showsPullToRefresh = YES
before
addPullToRefreshWithActionHandler or addInfiniteScrollingWithActionHandler
the scrollview will add observer twice and only remove once when it dealloc.

Because the condition in setShowsPullToRefreshandsetShowsInfiniteScrolling is like this
if (!self.pullToRefreshView.isObserving) {
if (!self.infiniteScrollingView.isObserving) {
Before you set the handler the pullToRefreshViewandinfiniteScrollingView is nil so the code run inside.

I already fix it and pull a request: #221

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