Commit c6872d2c700a9d27105debe93662ecaaf8beb3bd
1 parent
c16aa1ac
Clean up circular references in QPDF_Stream
Showing
3 changed files
with
11 additions
and
0 deletions
include/qpdf/QPDFObjectHandle.hh
libqpdf/QPDF_Stream.cc
| ... | ... | @@ -45,6 +45,13 @@ QPDF_Stream::~QPDF_Stream() |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | void |
| 48 | +QPDF_Stream::releaseResolved() | |
| 49 | +{ | |
| 50 | + this->stream_provider = 0; | |
| 51 | + QPDFObjectHandle::ReleaseResolver::releaseResolved(this->stream_dict); | |
| 52 | +} | |
| 53 | + | |
| 54 | +void | |
| 48 | 55 | QPDF_Stream::setObjGen(int objid, int generation) |
| 49 | 56 | { |
| 50 | 57 | if (! ((this->objid == 0) && (this->generation == 0))) | ... | ... |
libqpdf/qpdf/QPDF_Stream.hh
| ... | ... | @@ -43,6 +43,9 @@ class QPDF_Stream: public QPDFObject |
| 43 | 43 | // when adding streams to files. |
| 44 | 44 | void setObjGen(int objid, int generation); |
| 45 | 45 | |
| 46 | + protected: | |
| 47 | + virtual void releaseResolved(); | |
| 48 | + | |
| 46 | 49 | private: |
| 47 | 50 | static std::map<std::string, std::string> filter_abbreviations; |
| 48 | 51 | ... | ... |