Commit 989819b75fba380ecdc7416a504ed4b3a2d42ccb

Authored by Jay Berkenbilt
Committed by GitHub
2 parents 7e77af35 08d7b567

Merge pull request #947 from m-holger/null

Prevent destruction of shared null objects
Showing 1 changed file with 3 additions and 2 deletions
libqpdf/QPDF.cc
@@ -247,10 +247,11 @@ QPDF::~QPDF() @@ -247,10 +247,11 @@ QPDF::~QPDF()
247 // but we'll explicitly clear the xref table anyway just to 247 // but we'll explicitly clear the xref table anyway just to
248 // prevent any possibility of resolve() succeeding. 248 // prevent any possibility of resolve() succeeding.
249 this->m->xref_table.clear(); 249 this->m->xref_table.clear();
250 - auto null_obj = QPDF_Null::create();  
251 for (auto const& iter: this->m->obj_cache) { 250 for (auto const& iter: this->m->obj_cache) {
252 iter.second.object->disconnect(); 251 iter.second.object->disconnect();
253 - iter.second.object->destroy(); 252 + if (iter.second.object->getTypeCode() != ::ot_null) {
  253 + iter.second.object->destroy();
  254 + }
254 } 255 }
255 } 256 }
256 257