2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-26 23:23:34 +00:00

Merge pull request #947 from m-holger/null

Prevent destruction of shared null objects
This commit is contained in:
Jay Berkenbilt 2023-04-15 12:30:41 -04:00 committed by GitHub
commit 989819b75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,10 +247,11 @@ QPDF::~QPDF()
// but we'll explicitly clear the xref table anyway just to
// prevent any possibility of resolve() succeeding.
this->m->xref_table.clear();
auto null_obj = QPDF_Null::create();
for (auto const& iter: this->m->obj_cache) {
iter.second.object->disconnect();
iter.second.object->destroy();
if (iter.second.object->getTypeCode() != ::ot_null) {
iter.second.object->destroy();
}
}
}