nixnixnix wrote on Fri, 23 March 2012 01:59 |
Anyone manage to recreate the crash at least? |
void Wrap::OpenTowerXML(String path) { FileIn iFile(path); if(!iFile.IsOpen()) { PromptOK("failed to open file"); return; } // int k = int(iFile.GetSize()); int64 k = iFile.GetLeft(); char* pBuf = new char[k]; if(!iFile.GetAll(pBuf,k)) { iFile.Close(); delete[] pBuf; return; } iFile.Close(); String xml(pBuf); XmlNode xn = ParseXML(xml);
void Wrap::OpenTowerXML(String path) { GuiLock __; XmlNode xn; { String xml(LoadFile(path)); if (xml.IsVoid()) { PromptOK(Format("Failed to open '\1%s' file", path)); return; } try { xn = ParseXML(xml); } catch (XmlError e) { PromptOK(Format("XmlError for '%s' file:&%s", DeQtf(path), DeQtf(e))); return; } }
delete[] pBuf;
int64 k = iFile.GetLeft(); char* pBuf = new char[k];
int64 k = iFile.GetLeft(); char* pBuf = new char[k + 1]; pBuf[k] = '\0';