I have a memory problem using QDomNode as the XML file is too big so I'm trying to create a row in a QDomDocument, write it to a file and delete it. I'm creating an Excel file so every row has a lot of cells. If I create e cell and then delete it, every thing is ok and the memory problem is solved but if I create a row, fill it with many cells, write all to a file and then delete the row, the row and all its cells are not deleted.

I have debugged this line:

Qt Code:
  1. oldRow.parentNode().removeChild(oldRow);
To copy to clipboard, switch view to plain text mode 

and I've seen that in the QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild) method, the child is actually removed from the list, but it's not deleted.
How can delete it ?

I've also tried oldRow.clear() but nothing happens.