summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2019-01-31 09:21:39 +0000
committerAaron Bohy <aab@odoo.com>2019-02-18 09:34:14 +0000
commit005164d237d07f2ad8fe3528b9d4eb64a2a21efb (patch)
tree27c0a2df91c8f6ab2156715b8cb21d7d76e60f1e /addons
parent78a1ba3449307b346566c09cd9db50e91e128812 (diff)
[FIX] web: AbstractStorageService should destroy its storage
If that storage is destroy-able (aka RamStorage), storage objects are created "inline" without attachment (as they may or may not be parented) and this means those created implicitly in tests can't be tracked and cleanly destroyed even by destroying the storage service object. closes odoo/odoo#30790
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/js/core/abstract_storage_service.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/abstract_storage_service.js b/addons/web/static/src/js/core/abstract_storage_service.js
index 34dd24b2be6..ef828b5dd5c 100644
--- a/addons/web/static/src/js/core/abstract_storage_service.js
+++ b/addons/web/static/src/js/core/abstract_storage_service.js
@@ -13,6 +13,17 @@ var AbstractStorageService = AbstractService.extend({
// this abstraction
storage: null,
+ /**
+ * @override
+ */
+ destroy: function () {
+ // storage can be permanent or transient, destroy transient ones
+ if ((this.storage || {}).destroy) {
+ this.storage.destroy();
+ }
+ this._super.apply(this, arguments);
+ },
+
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------