StructElement::parseChild: Save copy() call
diff --git a/poppler/StructElement.cc b/poppler/StructElement.cc
index 250a1d3..3cde8c9 100644
--- a/poppler/StructElement.cc
+++ b/poppler/StructElement.cc
@@ -1177,7 +1177,7 @@
   }
 }
 
-StructElement *StructElement::parseChild(Object *ref,
+StructElement *StructElement::parseChild(const Object *ref,
                                          Object *childObj,
                                          std::set<int> &seen)
 {
@@ -1255,7 +1255,7 @@
   if (kids.isArray()) {
     for (int i = 0; i < kids.arrayGetLength(); i++) {
       Object obj = kids.arrayGet(i);
-      Object ref = kids.arrayGetNF(i).copy();
+      const Object &ref = kids.arrayGetNF(i);
       parseChild(&ref, &obj, seen);
     }
   } else if (kids.isDict() || kids.isInt()) {
diff --git a/poppler/StructElement.h b/poppler/StructElement.h
index 7c232a9..b654366 100644
--- a/poppler/StructElement.h
+++ b/poppler/StructElement.h
@@ -6,7 +6,7 @@
 //
 // Copyright 2013, 2014 Igalia S.L.
 // Copyright 2014 Luigi Scarso <luigi.scarso@gmail.com>
-// Copyright 2014, 2018 Albert Astals Cid <aacid@kde.org>
+// Copyright 2014, 2018, 2019 Albert Astals Cid <aacid@kde.org>
 // Copyright 2018 Adam Reichold <adam.reichold@t-online.de>
 //
 //========================================================================
@@ -298,7 +298,7 @@
   StructElement(const Ref ref, StructTreeRoot *treeRootA, StructElement *parentA);
 
   void parse(Dict* elementDict);
-  StructElement* parseChild(Object *ref, Object* childObj, std::set<int> &seen);
+  StructElement* parseChild(const Object *ref, Object* childObj, std::set<int> &seen);
   void parseChildren(Dict* element, std::set<int> &seen);
   void parseAttributes(Dict *element, bool keepExisting = false);