[FIX] web: avoid memory leak
Methods are bound on button but never release.
This commit is contained in:
committed by
Aaron Bohy
parent
dacb326695
commit
749d10e8b5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user