[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:
@@ -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
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user