We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bc91985 + 4c57ec4 commit fc04849Copy full SHA for fc04849
src/display/filter_factory.js
@@ -423,17 +423,18 @@ class DOMFilterFactory extends BaseFilterFactory {
423
}
424
425
destroy(keepHCM = false) {
426
- if (keepHCM && this.#hcmCache.size !== 0) {
+ if (keepHCM && this.#_hcmCache?.size) {
427
return;
428
429
- if (this.#_defs) {
430
- this.#_defs.parentNode.parentNode.remove();
431
- this.#_defs = null;
432
- }
433
- if (this.#_cache) {
434
- this.#_cache.clear();
435
- this.#_cache = null;
436
+ this.#_defs?.parentNode.parentNode.remove();
+ this.#_defs = null;
+
+ this.#_cache?.clear();
+ this.#_cache = null;
+ this.#_hcmCache?.clear();
+ this.#_hcmCache = null;
437
438
this.#id = 0;
439
440
0 commit comments