Details
Description
Let say we have a xml file named 'first.xml' with content as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE first [
<!ENTITY secondFile SYSTEM "second.xml">
]>
<first>
<child>
</child>
</first>
and we have a application code (main.cpp) as follows:
#include <QApplication>
#include <iostream>
#include <QtXml>
using namespace std;
int main( int argc, char** argv )
{
QApplication app( argc, argv );
QDomDocument iDomDocument;
QFile iFile( first.xml );
if ( false == iFile.open( QIODevice::ReadOnly ) )
QString iErrorMessage = "";
int iErrorLine;
int iErrorColumn;
if ( false == iDomDocument.setContent( &iFile, &iErrorMessage, &iErrorLine, &iErrorColumn ) )
QDomDocument iDoc2 = iDomDocument.cloneNode( true ).toDocument();
cout << "We are cool!" << endl;
return 0;
}
after calling iDomDocument.cloneNode( true ).toDocument();
my cpu usage goes to 50% (dual core processor) and memory usage started growing rapidly.
Hope you will able to reproduce this.
Regards
Grzegorz Wolszczak