aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/qpdf/QPDFWriter.hh3
-rw-r--r--libqpdf/QPDFWriter.cc6
2 files changed, 5 insertions, 4 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index a9d60672..56771e18 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -751,7 +751,8 @@ class QPDFWriter
std::string cur_data_key;
std::list<std::shared_ptr<Pipeline>> to_delete;
Pl_Count* pipeline;
- std::list<QPDFObjectHandle> object_queue;
+ std::vector<QPDFObjectHandle> object_queue;
+ size_t object_queue_front{0};
std::map<QPDFObjGen, int> obj_renumber;
std::map<int, QPDFXRefEntry> xref;
std::map<int, qpdf_offset_t> lengths;
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index e1225c34..383a6886 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -3363,9 +3363,9 @@ QPDFWriter::writeStandard()
}
// Now start walking queue, outputting each object.
- while (this->m->object_queue.size()) {
- QPDFObjectHandle cur_object = this->m->object_queue.front();
- this->m->object_queue.pop_front();
+ while (m->object_queue_front < m->object_queue.size()) {
+ QPDFObjectHandle cur_object = m->object_queue.at(m->object_queue_front);
+ ++m->object_queue_front;
writeObject(cur_object);
}