Dispose everything on destroy

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-10-29 13:44:10 +01:00
parent f430f46628
commit 4addd43aa2
5 changed files with 30 additions and 0 deletions

View File

@ -212,6 +212,12 @@ public class AccountVerificationController extends BaseController {
}
}
@Override
public void onDestroy() {
super.onDestroy();
dispose(null);
}
private void abortVerification() {
dispose(null);

View File

@ -360,6 +360,12 @@ public class CallsListController extends BaseController implements SearchView.On
searchQuery = savedViewState.getString(KEY_SEARCH_QUERY, "");
}
@Override
public void onDestroy() {
super.onDestroy();
dispose(null);
}
@Override
public boolean onQueryTextChange(String newText) {
if (adapter.hasNewSearchText(newText) || !TextUtils.isEmpty(searchQuery)) {

View File

@ -407,6 +407,12 @@ public class ContactsController extends BaseController implements SearchView.OnQ
searchQuery = savedViewState.getString(KEY_SEARCH_QUERY, "");
}
@Override
public void onDestroy() {
super.onDestroy();
dispose(null);
}
@Override
public boolean onQueryTextChange(String newText) {
if (adapter.hasNewSearchText(newText) || !TextUtils.isEmpty(searchQuery)) {

View File

@ -169,6 +169,12 @@ public class ServerSelectionController extends BaseController {
}
}
@Override
public void onDestroy() {
super.onDestroy();
dispose();
}
private void dispose() {
if (statusQueryDisposable != null && !statusQueryDisposable.isDisposed()) {
statusQueryDisposable.dispose();

View File

@ -274,6 +274,12 @@ public class WebViewLoginController extends BaseController {
}
}
@Override
public void onDestroy() {
super.onDestroy();
dispose();
}
@Override
protected void onDestroyView(@NonNull View view) {
super.onDestroyView(view);