From a8e79e960aa962b4b89710918a03a5983bf492c6 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 1 Sep 2016 15:26:41 +0200 Subject: [FIX] bus,im_odoo_support, web*: fix various memory leaks * Tip are never destroyed when change view mode * unbind methods * mail: memory leak with unbind methods * web: memory leak because 'ui-autocomplete' is never destroyed * web_editor: memory leak for wrong unbind on destroy * web: memory leak: must remove fileupload handler * bus: memory leak: correctly debind handlers on window in bus.Bus * remove handlers on switch buttons and views $buttons * remove handlers on breadcrumbs * web: memory leak: correctly debind handlers * im_odoo_support: memory leak: remove fileupload handler odoo_support Note: part of this commit was actually authored by aab --- addons/web/static/src/js/framework/view.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'addons/web/static/src/js/framework') diff --git a/addons/web/static/src/js/framework/view.js b/addons/web/static/src/js/framework/view.js index b234d02390f..bc06d062819 100644 --- a/addons/web/static/src/js/framework/view.js +++ b/addons/web/static/src/js/framework/view.js @@ -258,6 +258,12 @@ var View = Widget.extend({ get_context: function () { return {}; }, + destroy: function () { + if (this.$buttons) { + this.$buttons.off(); + } + return this._super.apply(this, arguments); + }, }); return View; -- cgit v1.2.3