From 29362e6afb36b446d58226a09275a614e0a1e266 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 6 Mar 2026 11:50:24 +0100 Subject: [PATCH] Remove the `JBig2CCITTFaxWasmImage` instance when running clean-up This follows the same pattern as the existing handling for the `JpxImage` instance. --- src/core/cleanup_helper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/cleanup_helper.js b/src/core/cleanup_helper.js index 5ada23cf3..966977bc3 100644 --- a/src/core/cleanup_helper.js +++ b/src/core/cleanup_helper.js @@ -16,6 +16,7 @@ import { clearPatternCaches } from "./pattern.js"; import { clearPrimitiveCaches } from "./primitives.js"; import { clearUnicodeCaches } from "./unicode.js"; +import { JBig2CCITTFaxWasmImage } from "./jbig2_ccittFax_wasm.js"; import { JpxImage } from "./jpx.js"; function clearGlobalCaches() { @@ -23,8 +24,9 @@ function clearGlobalCaches() { clearPrimitiveCaches(); clearUnicodeCaches(); - // Remove the global `JpxImage` instance, since it may hold a reference to - // the WebAssembly module. + // Remove the global `JBig2CCITTFaxWasmImage`/`JpxImage` instances, + // since they may hold references to the WebAssembly modules. + JBig2CCITTFaxWasmImage.cleanup(); JpxImage.cleanup(); }