From b6a43cfe9c136e298feaa8d48fc252fdb3d4e7c5 Mon Sep 17 00:00:00 2001 From: Sami Rosendahl Date: Mon, 9 Jan 2012 15:29:53 +0200 Subject: 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 --- tests/auto/xml/dom/qdom/tst_qdom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto') 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("featuresFalse"); QTest::addColumn("res"); -/* QTest::newRow( "01" ) << doc01 + QTest::newRow( "01" ) << doc01 << QStringList() << QString("http://trolltech.com/xml/features/report-whitespace-only-CharData").split(' ') << QString("\n" @@ -240,7 +240,7 @@ void tst_QDom::setContent_data() " \n" "\n"); - */ QTest::newRow("05") << QString("\n" + QTest::newRow("05") << QString("\n" " <b>foo</b>>]]>\n" "\n") << QStringList() << QStringList() -- cgit v1.2.3