Skip to content

Commit

Permalink
ROB: Cope with garbage collector during cloning (#1841)
Browse files Browse the repository at this point in the history
Fixes #1788
  • Loading branch information
pubpub-zz authored Jul 29, 2023
1 parent abd2673 commit 8188553
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pypdf/generic/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def _reference_clone(
if ind is not None:
if id(ind.pdf) not in pdf_dest._id_translated:
pdf_dest._id_translated[id(ind.pdf)] = {}
pdf_dest._id_translated[id(ind.pdf)]["PreventGC"] = ind.pdf # type: ignore
if (
not force_duplicate
and ind.idnum in pdf_dest._id_translated[id(ind.pdf)]
Expand Down

0 comments on commit 8188553

Please sign in to comment.