aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-04 17:03:52 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-04 19:12:37 +0100
commitabc300f05c00de72081203d89d9065b25f1ccb3c (patch)
tree3a679f3f3feb43a5ca3af536fb89832b0dd6e7b7 /libqpdf/QPDFWriter.cc
parentf0c2e0ef1e2b10b19fea60d5e6580910a92092e1 (diff)
downloadqpdf-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/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index ede35d7e..f426f151 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -132,9 +132,10 @@ QPDFWriter::setOutputFile(char const* description, FILE* file, bool close_file)
this->m->filename = description;
this->m->file = file;
this->m->close_file = close_file;
- Pipeline* p = new Pl_StdioFile("qpdf output", file);
+ std::shared_ptr<Pipeline> p = std::make_shared<Pl_StdioFile>(
+ "qpdf output", file);
this->m->to_delete.push_back(p);
- initializePipelineStack(p);
+ initializePipelineStack(p.get());
}
void
@@ -142,7 +143,8 @@ QPDFWriter::setOutputMemory()
{
this->m->filename = "memory buffer";
this->m->buffer_pipeline = new Pl_Buffer("qpdf output");
- this->m->to_delete.push_back(this->m->buffer_pipeline);
+ this->m->to_delete.push_back(
+ std::shared_ptr<Pipeline>(this->m->buffer_pipeline));
initializePipelineStack(this->m->buffer_pipeline);
}
@@ -1051,7 +1053,8 @@ void
QPDFWriter::initializePipelineStack(Pipeline *p)
{
this->m->pipeline = new Pl_Count("pipeline stack base", p);
- this->m->to_delete.push_back(this->m->pipeline);
+ this->m->to_delete.push_back(
+ std::shared_ptr<Pipeline>(this->m->pipeline));
this->m->pipeline_stack.push_back(this->m->pipeline);
}