mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-22 22:58:33 +00:00
Prevent destruction of shared null objects
#863 uses a single null object for nulls that were previously implicit. In certain circumstances this shared null object gets destroyed (i.e changed to a QPDF_Destroyed object) when a QPDF object is destroyed. Modify the QPDF destructor so that null objects get disconnected from the dying QPDF object but not destroyed to prevent this from happening.
This commit is contained in:
parent
7e77af3583
commit
08d7b56746
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user