Skip to content

Commit c2407fd

Browse files
committed
fix
1 parent 403d427 commit c2407fd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/odr/internal/pdf_poppler/poppler_pdf_file.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ void PopplerPdfFile::open(const std::optional<std::string> &password) {
2929
} else if (const std::shared_ptr memory_file =
3030
std::dynamic_pointer_cast<MemoryFile>(m_file);
3131
memory_file != nullptr) {
32-
// `stream` is freed by `m_pdf_doc`
33-
auto stream = new MemStream(memory_file->memory_data(), 0,
34-
static_cast<Goffset>(memory_file->size()),
35-
Object(objNull));
36-
m_pdf_doc = std::make_shared<PDFDoc>(stream, password_goo, password_goo);
32+
auto stream = std::make_unique<MemStream>(
33+
memory_file->memory_data(), 0,
34+
static_cast<Goffset>(memory_file->size()), Object::null());
35+
m_pdf_doc =
36+
std::make_shared<PDFDoc>(std::move(stream), password_goo, password_goo);
3737
} else {
3838
throw NoPdfFile();
3939
}

0 commit comments

Comments
 (0)