diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-04 17:03:52 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-04 19:12:37 +0100 |
commit | abc300f05c00de72081203d89d9065b25f1ccb3c (patch) | |
tree | 3a679f3f3feb43a5ca3af536fb89832b0dd6e7b7 /libqpdf/QPDF_Stream.cc | |
parent | f0c2e0ef1e2b10b19fea60d5e6580910a92092e1 (diff) | |
download | qpdf-abc300f05c00de72081203d89d9065b25f1ccb3c.tar.zst |
Replace containers of PointerHolder with containers of std::shared_ptr
None of these are in the public API.
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r-- | libqpdf/QPDF_Stream.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index 8137e211..d905d491 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -463,34 +463,36 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp, // create to be deleted when this function finishes. Pipelines // created by QPDFStreamFilter objects will be deleted by those // objects. - std::vector<PointerHolder<Pipeline>> to_delete; + std::vector<std::shared_ptr<Pipeline>> to_delete; PointerHolder<ContentNormalizer> normalizer; + std::shared_ptr<Pipeline> new_pipeline; if (filter) { if (encode_flags & qpdf_ef_compress) { - pipeline = new Pl_Flate("compress stream", pipeline, - Pl_Flate::a_deflate); - to_delete.push_back(pipeline); + new_pipeline = std::make_shared<Pl_Flate>( + "compress stream", pipeline, Pl_Flate::a_deflate); + to_delete.push_back(new_pipeline); + pipeline = new_pipeline.get(); } if (encode_flags & qpdf_ef_normalize) { normalizer = new ContentNormalizer(); - pipeline = new Pl_QPDFTokenizer( + new_pipeline = std::make_shared<Pl_QPDFTokenizer>( "normalizer", normalizer.get(), pipeline); - to_delete.push_back(pipeline); + to_delete.push_back(new_pipeline); + pipeline = new_pipeline.get(); } - for (std::vector<PointerHolder< - QPDFObjectHandle::TokenFilter> >::reverse_iterator iter = - this->token_filters.rbegin(); + for (auto iter = this->token_filters.rbegin(); iter != this->token_filters.rend(); ++iter) { - pipeline = new Pl_QPDFTokenizer( + new_pipeline = std::make_shared<Pl_QPDFTokenizer>( "token filter", (*iter).get(), pipeline); - to_delete.push_back(pipeline); + to_delete.push_back(new_pipeline); + pipeline = new_pipeline.get(); } for (auto f_iter = filters.rbegin(); |