Skip to content

Commit

Permalink
Check if listener is disposed in viewattacheventsobservable
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Nov 27, 2017
1 parent a0d8556 commit 22ba683
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ final class ViewAttachEventsObservable extends Observable<ViewLifecycleEvent> {
observer.onNext(ViewLifecycleEvent.ATTACH);
}
view.addOnAttachStateChangeListener(listener);
if (listener.isDisposed()) {
view.removeOnAttachStateChangeListener(listener);
}
}

static final class Listener extends MainThreadDisposable
Expand Down

0 comments on commit 22ba683

Please sign in to comment.