Hello,

I am getting the following run-time error when I try to create a QDomDocument:

HEAP[RoboExtract.exe]: Invalid Address specified to RtlFreeHeap( 00BD0000, 00CA7EC8 )
Windows has triggered a breakpoint in RoboExtract.exe.

This may be due to a corruption of the heap, which indicates a bug in RoboExtract.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while RoboExtract.exe has focus.

The output window may have more diagnostic information.
The program '[5528] RoboExtract.exe: Native' has exited with code 0 (0x0).
I originally copied the code from another project of mine, which has no trouble compiling.

I tried different parts of the code, and I believe that it starts to occur when I create a QDomDocument:

Qt Code:
  1. void RoboExtract::openDocument(QString dir, QString docName) //opens and returns document
  2. {
  3. QDir::setCurrent(dir);
  4. qDebug()<< QDir::currentPath();
  5. QDomDocument doc("mydocument"); //<----If I comment all other lines but this one, I still get the error
  6. QFile file;
  7. file.setFileName(docName);
  8. qDebug()<<"file name:"<<file.fileName();
  9. qDebug()<<"directory:" << dir;
  10. if (!file.open(QIODevice::ReadOnly)){ return doc;}
  11. if (!doc.setContent(&file)) { file.close();
  12. return doc;
  13. }
  14. file.close();
  15.  
  16. return;
  17. }
To copy to clipboard, switch view to plain text mode 

The runtime error doesn't happen until we return to the function that originally called it:

Qt Code:
  1. void RoboExtract::readFiles(QDir directory, QString parameter)
  2. {
  3. ...
  4. openDocument(dir, docName); //function that was called (above)
  5. return; //<--when I step through, this is where the error pops up
  6. }
To copy to clipboard, switch view to plain text mode 

The includes are:

#include "RoboExtract.h"
#include <QApplication>
#include <QTextStream>
#include <QDir>
#include "qdom.h"
#include <QtDebug>
And if I click continue when this error pops up, it continues running without anymore trouble...

Has anyone else experienced this? Thanks!

edit: I am using Windows XP, Visual C++ 2008 express and Qt 4.4.1