From 9d6f23c20bb03378453492744d52c16ea9dc0e75 Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Tue, 25 Jul 2023 14:02:44 +0000 Subject: [PATCH] [FIX] web: avoid monokai ace editors leaking memory in qunit suite When attempting to instantiate an ace editor with a given theme, ace will first create the editor with the default theme (textmate) which is always loaded, and register a callback to be called after the non-default theme has been loaded. This callback holds a reference to the editor's renderer which can itself retain large objects such as an entire owl application. These callbacks are not cleared even if the corresponding editor is destroyed. Because in tests, the theme "monokai" was not included and ace cannot load it on its own, all tests that attempt to create an ace editor with that theme will leak memory. This commit fixes the issue by adding theme-monokai to the qunit suite assets. closes odoo/odoo#129813 X-original-commit: e8c77c5737c2170bb6b53d3e667aec7318dde5b8 Related: odoo/enterprise#44653 Signed-off-by: Aaron Bohy (aab) Signed-off-by: Samuel Degueldre (sad) --- addons/web/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index 44e237e6d07..e3d8afa621e 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -596,6 +596,7 @@ This module provides the core of the Odoo Web Client. 'web/static/lib/ace/mode-xml.js', 'web/static/lib/ace/mode-js.js', 'web/static/lib/ace/mode-qweb.js', + 'web/static/lib/ace/theme-monokai.js', 'web/static/lib/nearest/jquery.nearest.js', 'web/static/lib/stacktracejs/stacktrace.js', 'web/static/lib/Chart/Chart.js',