2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-28 21:19:06 +00:00
qpdf/libqpdf/QPDFValueProxy.cc
Jay Berkenbilt dba61da1bf Create a special "destroyed" type rather than using null
When a QPDF is destroyed, changing indirect objects to direct nulls
makes them effectively disappear silently when they sneak into other
places. Instead, we should treat this as an error. Adding a destroyed
object type makes this possible.
2022-09-08 10:36:39 -04:00

19 lines
346 B
C++

#include <qpdf/QPDFValueProxy.hh>
#include <qpdf/QPDF.hh>
#include <qpdf/QPDF_Destroyed.hh>
void
QPDFValueProxy::doResolve()
{
auto og = value->og;
QPDF::Resolver::resolve(value->qpdf, og);
}
void
QPDFValueProxy::destroy()
{
// See comments in reset() for why this isn't part of reset.
value = QPDF_Destroyed::getInstance();
}