summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSami Rosendahl <ext-sami.1.rosendahl@nokia.com>2012-01-09 15:29:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-10 02:01:41 +0100
commitb6a43cfe9c136e298feaa8d48fc252fdb3d4e7c5 (patch)
tree57aee9e616ecc1be56c9a2aef685b195a1a1b6eb /tests
parentacdd5fecb7075a4857f04f655da157b5ee1088c7 (diff)
Fix memory leak in QDomDocument entity text expansion
The created entity node's reference count needs to be decremented to 0 before it is added as a child, because appendChild will increment the reference count to correct value of 1. Re-enabled commented-out test data tst_QDom::setContent to exercise the code path with the leak. Change-Id: Ieb015d68ba9bbb3f20dd47e76835ad15abb1738e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
index aa9e92b0a9..b5dc2e6081 100644
--- a/tests/auto/xml/dom/qdom/tst_qdom.cpp
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -168,7 +168,7 @@ void tst_QDom::setContent_data()
QTest::addColumn<QStringList>("featuresFalse");
QTest::addColumn<QString>("res");
-/* QTest::newRow( "01" ) << doc01
+ QTest::newRow( "01" ) << doc01
<< QStringList()
<< QString("http://trolltech.com/xml/features/report-whitespace-only-CharData").split(' ')
<< QString("<!DOCTYPE a1>\n"
@@ -240,7 +240,7 @@ void tst_QDom::setContent_data()
" </b3>\n"
"</a1>\n");
- */ QTest::newRow("05") << QString("<message>\n"
+ QTest::newRow("05") << QString("<message>\n"
" <body>&lt;b&gt;foo&lt;/b&gt;>]]&gt;</body>\n"
"</message>\n")
<< QStringList() << QStringList()