Do not deliver result if view is destroyed

This commit is contained in:
ByteHamster 2019-05-14 22:19:56 +02:00
parent b617397397
commit 068a4255c1
2 changed files with 18 additions and 0 deletions

View File

@ -62,6 +62,15 @@ public class ChaptersFragment extends ListFragment {
EventBus.getDefault().register(this);
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (disposable != null) {
disposable.dispose();
}
}
@Override
public void onStop() {
super.onStop();

View File

@ -115,4 +115,13 @@ public class CoverFragment extends Fragment {
controller.release();
controller = null;
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (disposable != null) {
disposable.dispose();
}
}
}