mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
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
1 changed files with 10 additions and 9 deletions
|
@ -423,17 +423,18 @@ class DOMFilterFactory extends BaseFilterFactory {
|
|||
}
|
||||
|
||||
destroy(keepHCM = false) {
|
||||
if (keepHCM && this.#hcmCache.size !== 0) {
|
||||
if (keepHCM && this.#_hcmCache?.size) {
|
||||
return;
|
||||
}
|
||||
if (this.#_defs) {
|
||||
this.#_defs.parentNode.parentNode.remove();
|
||||
this.#_defs = null;
|
||||
}
|
||||
if (this.#_cache) {
|
||||
this.#_cache.clear();
|
||||
this.#_cache = null;
|
||||
}
|
||||
this.#_defs?.parentNode.parentNode.remove();
|
||||
this.#_defs = null;
|
||||
|
||||
this.#_cache?.clear();
|
||||
this.#_cache = null;
|
||||
|
||||
this.#_hcmCache?.clear();
|
||||
this.#_hcmCache = null;
|
||||
|
||||
this.#id = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue