[poppler] qt5/src qt6/src
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jul 8 20:19:37 UTC 2021
qt5/src/poppler-qt5.h | 5 +++++
qt6/src/poppler-qt6.h | 5 +++++
2 files changed, 10 insertions(+)
New commits:
commit ab409a6ec85dc7511dbe8ea6b2e4d7897f36670b
Author: Oliver Sander <oliver.sander at tu-dresden.de>
Date: Thu Jul 8 20:56:49 2021 +0200
Document that a document has to outlive its pages
Because the Page objects handed out by Document objects store a
pointer to the document. If the Document object is deleted
before a Page object it handed out, that Page object will have
a stale pointer.
diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h
index a55fb9a4..75f51e7c 100644
--- a/qt5/src/poppler-qt5.h
+++ b/qt5/src/poppler-qt5.h
@@ -1339,6 +1339,11 @@ public:
This function can return nullptr if for some reason the page can't be properly parsed.
\param index the page number index
+
+ \warning The Page object returned by this method internally stores a pointer
+ to the document that it was created from. This pointer will go stale if you
+ delete the Document object. Therefore the Document object needs to be kept alive
+ as long as you want to use the Page object.
*/
Page *page(int index) const;
diff --git a/qt6/src/poppler-qt6.h b/qt6/src/poppler-qt6.h
index bad34bc5..2ab7097d 100644
--- a/qt6/src/poppler-qt6.h
+++ b/qt6/src/poppler-qt6.h
@@ -1216,6 +1216,11 @@ public:
This function can return empty unique pointer if for some reason the page can't be properly parsed.
\param index the page number index
+
+ \warning The Page object returned by this method internally stores a pointer
+ to the document that it was created from. This pointer will go stale if you
+ delete the Document object. Therefore the Document object needs to be kept alive
+ as long as you want to use the Page object.
*/
std::unique_ptr<Page> page(int index) const;
More information about the poppler
mailing list