Fixed memory leak in QXmlStreamReader
Fixed memory leak caused by repetitive usage of the same QXmlStreamReader instance. Task-number: QTBUG-27889 Change-Id: I673f4d26bae1503cb43e972f95b418dbf6d6fd89 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This commit is contained in:
parent
f9497b1a54
commit
342c99ff45
@ -784,6 +784,7 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
|
||||
NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();
|
||||
namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml"));
|
||||
namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace"));
|
||||
initialTagStackStringStorageSize = tagStackStringStorageSize;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_XMLSTREAMREADER
|
||||
@ -854,6 +855,7 @@ void QXmlStreamReaderPrivate::init()
|
||||
rawReadBuffer.clear();
|
||||
dataBuffer.clear();
|
||||
readBuffer.clear();
|
||||
tagStackStringStorageSize = initialTagStackStringStorageSize;
|
||||
|
||||
type = QXmlStreamReader::NoToken;
|
||||
error = QXmlStreamReader::NoError;
|
||||
|
@ -697,6 +697,7 @@ public:
|
||||
QXmlStreamSimpleStack<NamespaceDeclaration> namespaceDeclarations;
|
||||
QString tagStackStringStorage;
|
||||
int tagStackStringStorageSize;
|
||||
int initialTagStackStringStorageSize;
|
||||
bool tagsDone;
|
||||
|
||||
inline QStringRef addToStringStorage(const QStringRef &s) {
|
||||
|
Loading…
Reference in New Issue
Block a user