I'm implementing MVP pattern in Android and I'm using EventBus to let know the Presenter from activity "A" that something happen at activity "B" to update views from "A".
I registered the presenter to EventBus inside in constructor but I don't see any place where I could unregister it.
public class PresenterA extends nucleus.presenter.Presenter<ViewA> {
public PresenterA() {
EventBus.getDefault().register(this);
}
public void onEvent(ChangesEvent e) {
// change views
}
}
- Is it necessary to unregister at all, when the presenter is suppose to live as long as application (it is not recreated on configuration change)?
- When user leaves the application (closes activity "A") will the references be freed or is it a memory leak?