diff options
author | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-09-04 17:26:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-04 17:26:44 +0200 |
commit | 952b00aecd7bfdf9db50eb6b3d922ce17e1b606c (patch) | |
tree | a438e346b4e124ba8babdec1effca4f8b9386a7d /libqpdf/QPDF.cc | |
parent | 6d2db68f2ecd1f8b0945bc982af7a9807436d881 (diff) | |
parent | 9c86ba40d80ee3b58801dfe77e47fbc5a9dd6066 (diff) | |
download | qpdf-952b00aecd7bfdf9db50eb6b3d922ce17e1b606c.tar.zst |
Merge pull request #755 from m-holger/tidy3
Fix commit 805c1ad : Reset QPDFValue::qpdf and QPDFValue::og when ...
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r-- | libqpdf/QPDF.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 49a33633..15636d34 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -249,17 +249,16 @@ QPDF::~QPDF() // std::shared_ptr objects will prevent the objects from being // deleted. Walk through all objects in the object cache, which // is those objects that we read from the file, and break all - // resolved references. At this point, obviously no one is still + // resolved indirect references by replacing them with direct + // null objects. At this point, obviously no one is still // using the QPDF object, but we'll explicitly clear the xref // table anyway just to prevent any possibility of resolve() // succeeding. Note that we can't break references like this at - // any time when the QPDF object is active. If we do, the next - // reference will reread the object from the file, which would - // have the effect of undoing any modifications that may have been - // made to any of the objects. + // any time when the QPDF object is active. this->m->xref_table.clear(); + auto null_obj = QPDF_Null::create(); for (auto const& iter: this->m->obj_cache) { - iter.second.object->releaseResolved(); + iter.second.object->assign(null_obj); iter.second.object->resetObjGen(); } } |