View model on clear

This commit is contained in:
M66B 2018-10-21 14:07:45 +00:00
parent d31177c78e
commit 91ea751d59
2 changed files with 14 additions and 0 deletions

View File

@ -50,6 +50,14 @@ public class ViewModelBrowse extends ViewModel {
this.loaded = 0;
}
@Override
protected void onCleared() {
context = null;
istore = null;
ifolder = null;
imessages = null;
}
Context getContext() {
return context;
}
@ -158,6 +166,7 @@ public class ViewModelBrowse extends ViewModel {
} catch (Throwable ex) {
Log.e(Helper.TAG, "Boundary " + ex + "\n" + Log.getStackTraceString(ex));
} finally {
context = null;
istore = null;
ifolder = null;
imessages = null;

View File

@ -10,6 +10,11 @@ public class ViewModelMessages extends ViewModel {
this.messages = messages;
}
@Override
protected void onCleared() {
messages = null;
}
Target[] getPrevNext(String thread) {
if (messages == null)
return new Target[]{null, null};