summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-11-15 11:40:35 +0000
committerfw-bot <otis@odoo.com>2019-11-15 17:10:56 +0000
commitd57e0cb1e7bc8d866fc847b67343e59fde08ccd9 (patch)
tree3b267bafa70ef3381dd4680f55d4783b58e36439
parentbddf5a674796679db753248b22fecf2c0971065e (diff)
[FIX] web_editor: remove destroyed editors from memory
Commit https://github.com/odoo/odoo/commit/f6bbc40fbe16ea5ab01ad03b8e1519c4e559bf6d introduced a method to destroy all current editors to refresh them when necessary... but forgot to empty the array that contains them. In a 12.0 without custo, this is only slowing down the editor but in master (or with custo) this makes the editor crash. closes odoo/odoo#40372 X-original-commit: 2b5661937d9772b98c73f9f64aa419fec7676052 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js
index f0b1b1e2549..4258fda46a1 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -1103,6 +1103,7 @@ var SnippetsMenu = Widget.extend({
_.each(this.snippetEditors, function (snippetEditor) {
snippetEditor.destroy();
});
+ this.snippetEditors.splice(0);
},
/**
* Calls a given callback 'on' the given snippet and all its child ones if