nhaarman / acorn

Mastering Android navigation :chipmunk:
https://nhaarman.github.io/acorn
Apache License 2.0
181 stars 7 forks source link

Don't use replay(1) to cache View references #137

Closed nhaarman closed 5 years ago

nhaarman commented 5 years ago

The replay operator internally caches N+1 elements instead of just N, meaning it will keep a strong reference to the previous emitted element. When this element references an Activity, leaks occur.

See https://github.com/ReactiveX/RxJava/issues/6475.