我有一个要删除的对象:
XMLDoc = new TXMLDocument(NULL);
但我不知道该怎么做......它不起作用:
delete XMLDoc;
XMLDoc->free();
当我尝试删除对象时,程序崩溃。
所以这是我的一段代码。我有一堂课:
class C_XMLhandler{
private:
TXMLDocument *XMLDoc;
...
...
public:
void loadXMLfile(String name);
...
...
};
and example declaration of method:
bool C_XMLhandler::loadXMLfile(String name)
{
XMLDoc = new TXMLDocument(NULL);
Box=GetMagicBox(XMLDoc); //it's XML parser method, and it's doesen't matter
delete XMLDoc; //when i reach this line the program scrashes
}