- int main(int argc, char *argv[])
- { QString xmlPath="E:\\12.xml";
- QFile file(xmlPath);
- if (!file.open(QIODevice::ReadOnly| QIODevice::Text))
- { return 0;
- }
- QDomDocument doc;
- QString errorStr;
- int errorLine, errorCol;
- if (!doc.setContent(&file, false, &errorStr, &errorLine, &errorCol))//
- { file.close();
- }
- } //运行到这里退出main函数时会出现错误:windows在.exe触发一个断点,其原因可能是堆被损坏.......
程序中如果有doc.setContent(&file, false, &errorStr, &errorLine, &errorCol)这句,那么main函数程序结束时(doc生命周期结束)总是
出错,求教