Merge pull request #19059 from Snuffleupagus/DOMFilterFactory-rm-_hcmCache
Improve clean-up of `#_hcmCache`-data in `DOMFilterFactory.prototype.destroy`
This commit is contained in:
commit
fc0484904e
@ -423,17 +423,18 @@ class DOMFilterFactory extends BaseFilterFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy(keepHCM = false) {
|
destroy(keepHCM = false) {
|
||||||
if (keepHCM && this.#hcmCache.size !== 0) {
|
if (keepHCM && this.#_hcmCache?.size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.#_defs) {
|
this.#_defs?.parentNode.parentNode.remove();
|
||||||
this.#_defs.parentNode.parentNode.remove();
|
|
||||||
this.#_defs = null;
|
this.#_defs = null;
|
||||||
}
|
|
||||||
if (this.#_cache) {
|
this.#_cache?.clear();
|
||||||
this.#_cache.clear();
|
|
||||||
this.#_cache = null;
|
this.#_cache = null;
|
||||||
}
|
|
||||||
|
this.#_hcmCache?.clear();
|
||||||
|
this.#_hcmCache = null;
|
||||||
|
|
||||||
this.#id = 0;
|
this.#id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user