Skip to content

Commit 8188553

Browse files
authored
ROB: Cope with garbage collector during cloning (py-pdf#1841)
Fixes py-pdf#1788
1 parent abd2673 commit 8188553

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pypdf/generic/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def _reference_clone(
128128
if ind is not None:
129129
if id(ind.pdf) not in pdf_dest._id_translated:
130130
pdf_dest._id_translated[id(ind.pdf)] = {}
131+
pdf_dest._id_translated[id(ind.pdf)]["PreventGC"] = ind.pdf # type: ignore
131132
if (
132133
not force_duplicate
133134
and ind.idnum in pdf_dest._id_translated[id(ind.pdf)]

0 commit comments

Comments
 (0)