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:
parent
dd5618ebed
commit
ec1a05c104
1 changed files with 5 additions and 0 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue