Major fix to memory leaks. Hurray this is 99% of all leaks.

This commit is contained in:
Samuel Clay 2014-02-04 12:03:03 -08:00
parent 7a3dce136f
commit 560acc75b5
2 changed files with 10 additions and 0 deletions

View file

@ -62,6 +62,10 @@ NEWSBLUR.Views.FeedTitleView = Backbone.View.extend({
},
remove: function() {
if (this.counts_view) {
this.counts_view.destroy();
}
this.stopListening(this.model);
Backbone.View.prototype.remove.call(this);
},

View file

@ -49,6 +49,12 @@ NEWSBLUR.Views.Folder = Backbone.View.extend({
},
destroy: function() {
if (this.folder_count) {
this.folder_count.destroy();
}
if (this.search_view) {
this.search_view.remove();
}
if (this.model) {
this.model.unbind(null, null, this);
if (!this.options.feedbar) {