mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
And remove some memory cleanup due to issues with the Contacts view
This commit is contained in:
parent
4e4ba12770
commit
d0bcb5483a
4 changed files with 43 additions and 49 deletions
|
|
@ -46,18 +46,20 @@ export class AbstractModel {
|
|||
|
||||
/** Called by delegateRunOnDestroy */
|
||||
onDestroy() {
|
||||
/** clear ko.subscribe */
|
||||
/** dispose ko subscribables */
|
||||
this.subscribables.forEach(dispose);
|
||||
/** clear object entries */
|
||||
Object.entries(this).forEach(([key, value]) => {
|
||||
// Object.entries(this).forEach(([key, value]) => {
|
||||
Object.values(this).forEach(value => {
|
||||
/** clear CollectionModel */
|
||||
let arr = ko.isObservableArray(value) ? value() : value;
|
||||
arr && arr.onDestroy && value.onDestroy();
|
||||
/** destroy ko.observable/ko.computed? */
|
||||
dispose(value);
|
||||
/** clear object value */
|
||||
this[key] = null;
|
||||
// this[key] = null; // TODO: issue with Contacts view
|
||||
});
|
||||
// this.subscribables = [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue