summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/serialization/qxmlstream.cpp7
-rw-r--r--src/corelib/serialization/qxmlstream_p.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index dfa36ea642..7ff87885a5 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -69,6 +69,8 @@ public: \
{ return QString::fromLatin1(sourceText); } \
private:
#endif
+#include <private/qmemory_p.h>
+
QT_BEGIN_NAMESPACE
#include "qxmlstream_p.h"
@@ -848,7 +850,7 @@ void QXmlStreamReaderPrivate::init()
#endif
attributeStack.clear();
attributeStack.reserve(16);
- entityParser = nullptr;
+ entityParser.reset();
hasCheckedStartDocument = false;
normalizeLiterals = false;
hasSeenTag = false;
@@ -881,7 +883,7 @@ void QXmlStreamReaderPrivate::parseEntity(const QString &value)
if (!entityParser)
- entityParser = new QXmlStreamReaderPrivate(q);
+ entityParser = qt_make_unique<QXmlStreamReaderPrivate>(q);
else
entityParser->init();
entityParser->inParseEntity = true;
@@ -911,7 +913,6 @@ QXmlStreamReaderPrivate::~QXmlStreamReaderPrivate()
#endif
free(sym_stack);
free(state_stack);
- delete entityParser;
}
diff --git a/src/corelib/serialization/qxmlstream_p.h b/src/corelib/serialization/qxmlstream_p.h
index cde66a48a3..9c94e6d434 100644
--- a/src/corelib/serialization/qxmlstream_p.h
+++ b/src/corelib/serialization/qxmlstream_p.h
@@ -981,7 +981,7 @@ public:
QString resolveUndeclaredEntity(const QString &name);
void parseEntity(const QString &value);
- QXmlStreamReaderPrivate *entityParser;
+ std::unique_ptr<QXmlStreamReaderPrivate> entityParser;
bool scanAfterLangleBang();
bool scanPublicOrSystem();