summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Reichold <adam.reichold@t-online.de>2020-05-05 01:22:29 +0000
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-05-19 21:06:58 +0000
commit2cd79c7382888559d5d8dcc56a84572ac8a77086 (patch)
tree1e729b264131d9d3c0d533cc1785d72bc896670c
parent7279b4eb397667cd4553f5852286b3f3d73a1a83 (diff)
[cpp] construct a font_iterator instance in the local storage of page_private::init_font_info_cache() method, instead of the heap
-rw-r--r--cpp/poppler-page.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp
index 3aa6222b..b0bf847e 100644
--- a/cpp/poppler-page.cpp
+++ b/cpp/poppler-page.cpp
@@ -61,14 +61,12 @@ size_t page_private::init_font_info_cache()
if (font_info_cache.size() > 0)
return font_info_cache.size();
- poppler::font_iterator* font_iterator = new poppler::font_iterator(index, doc);
+ poppler::font_iterator it(index, doc);
- if (font_iterator->has_next()) {
- font_info_cache = font_iterator->next();
+ if (it.has_next()) {
+ font_info_cache = it.next();
}
- delete font_iterator;
-
return font_info_cache.size();
}