Browse Source

View model on clear

main
M66B 6 years ago
parent
commit
91ea751d59
2 changed files with 14 additions and 0 deletions
  1. +9
    -0
      app/src/main/java/eu/faircode/email/ViewModelBrowse.java
  2. +5
    -0
      app/src/main/java/eu/faircode/email/ViewModelMessages.java

+ 9
- 0
app/src/main/java/eu/faircode/email/ViewModelBrowse.java View File

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


+ 5
- 0
app/src/main/java/eu/faircode/email/ViewModelMessages.java View File

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


Loading…
Cancel
Save