[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
This commit is contained in:
Xavier Morel
2019-02-18 09:34:14 +00:00
committed by Aaron Bohy
parent 78a1ba3449
commit 005164d237
@@ -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
//--------------------------------------------------------------------------