Skip to content

Commit

Permalink
Don't reset temporary XRef-entries during saving (PR 16392 follow-up)
Browse files Browse the repository at this point in the history
*Please note:* I'm not aware of any bugs caused by this, however that might be more luck than anything else.

In PR 16392 the `incrementalUpdate` function, and all of its various helpers, were made asynchronous. However the call-site in `src/core/worker.js` wasn't updated, which means that we currently reset temporary XRef-entries while saving is currently ongoing.
  • Loading branch information
Snuffleupagus committed Jul 20, 2023
1 parent 0702663 commit 51fd79c
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/core/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,23 +661,21 @@ class WorkerMessageHandler {
};
}

try {
return incrementalUpdate({
originalData: stream.bytes,
xrefInfo: newXrefInfo,
newRefs,
xref,
hasXfa: !!xfa,
xfaDatasetsRef,
hasXfaDatasetsEntry,
needAppearances,
acroFormRef,
acroForm,
xfaData,
});
} finally {
return incrementalUpdate({
originalData: stream.bytes,
xrefInfo: newXrefInfo,
newRefs,
xref,
hasXfa: !!xfa,
xfaDatasetsRef,
hasXfaDatasetsEntry,
needAppearances,
acroFormRef,
acroForm,
xfaData,
}).finally(() => {
xref.resetNewTemporaryRef();
}
});
});
}
);
Expand Down

0 comments on commit 51fd79c

Please sign in to comment.