1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Add missing startWorkerTask calls in the "SaveDocument" handler

Without these calls we'll not actually wait for saving to complete when document destruction runs; compare with other `WorkerTask`-usage in this file.
While I cannot imagine that this has caused any problems for library users, the code is however not technically correct as-is.
This commit is contained in:
Jonas Jenwald 2024-12-21 14:15:28 +01:00
parent dd5618ebed
commit ec1a05c104

View file

@ -177,6 +177,7 @@ class WorkerMessageHandler {
if (isPureXfa) {
const task = new WorkerTask("loadXfaFonts");
startWorkerTask(task);
await Promise.all([
pdfManager
.loadXfaFonts(handler, task)
@ -590,6 +591,8 @@ class WorkerMessageHandler {
newAnnotationPromises.push(
pdfManager.getPage(pageIndex).then(page => {
const task = new WorkerTask(`Save (editor): page ${pageIndex}`);
startWorkerTask(task);
return page
.saveNewAnnotations(
handler,
@ -637,6 +640,8 @@ class WorkerMessageHandler {
promises.push(
pdfManager.getPage(pageIndex).then(function (page) {
const task = new WorkerTask(`Save: page ${pageIndex}`);
startWorkerTask(task);
return page
.save(handler, task, annotationStorage, changes)
.finally(function () {