Clear message collections when the window is closed

We don't need to keep them in memory if we're done viewing them,
plus it avoids having to re-render a large collection when we re-open a
conversation. Now that we only load a sensible number of messages at a
time, caching them between usages is less valuable. Removing them from
the collection should free them for garbage collection.

// FREEBIE
This commit is contained in:
lilia 2015-11-10 20:40:36 -08:00
parent 2fc78ddd7d
commit 765668b3d3

View file

@ -62,6 +62,7 @@
this.appWindow.contentWindow.removeEventListener('focus', onFocus);
window.autosize.destroy(this.$messageField);
this.remove();
this.model.messageCollection.reset([]);
}.bind(this));
this.fetchMessages();