From e2f6d32524fd29e31caed1266ce831f32ea560b8 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Wed, 30 Sep 2026 14:59:47 +0000 Subject: [PATCH] pdfjs: Reset canvas_logs in tearDownPdfJS and call validate (#289) Reset the canvas_logs array in tearDownPdfJS to prevent accumulating logs across benchmark runs. Hook up validate() on class Benchmark so tearDownPdfJS() is executed at the end of the benchmark run to verify rendering output and allow GC of the canvas logs and global PDFJS state. Fixes #289 --- Octane/pdfjs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Octane/pdfjs.js b/Octane/pdfjs.js index 9cfa0eb3..b70f2a34 100644 --- a/Octane/pdfjs.js +++ b/Octane/pdfjs.js @@ -77,6 +77,7 @@ function tearDownPdfJS() { throw message; } } + canvas_logs = []; // Allow GC of global state. delete this.PDFJS; delete this.PdfJS_window; @@ -33052,6 +33053,10 @@ class Benchmark { runIteration() { runPdfJS(); } + + validate() { + tearDownPdfJS(); + } } setupPdfJS();