[FIX] web: avoid memory leak

Methods are bound on button but never release.
This commit is contained in:
Christophe Matthieu
2017-04-11 19:44:38 +02:00
committed by Aaron Bohy
parent dacb326695
commit 749d10e8b5
3 changed files with 20 additions and 0 deletions
@@ -33,6 +33,15 @@ var FormController = BasicController.extend({
this.toolbar = params.toolbar;
this.mode = params.mode;
},
/**
* @override
*/
destroy: function () {
if (this.$buttons) {
this.$buttons.find('*').off();
}
this._super();
},
//--------------------------------------------------------------------------
// Public
@@ -43,6 +43,11 @@ var KanbanController = BasicController.extend({
// true iff grouped by an m2o field and group_create action enabled
this.create_column_enabled = false;
},
destroy: function () {
if (this.$buttons) {
this.$buttons.off();
}
},
//--------------------------------------------------------------------------
// Public
@@ -42,6 +42,12 @@ var ListController = BasicController.extend({
this.noLeaf = params.noLeaf;
this.selectedRecords = []; // there is no selected record by default
},
destroy: function () {
if (this.$buttons) {
this.$buttons.find('*').off();
}
this._super();
},
//--------------------------------------------------------------------------
// Public