Home » U++ Library support » U++ Core » ParseXML intermittent crash
Re: ParseXML intermittent crash [message #35817 is a reply to message #35806] |
Fri, 23 March 2012 15:04 |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Hello, Nick.
nixnixnix wrote on Fri, 23 March 2012 01:59 | Anyone manage to recreate the crash at least?
|
Yes, if throwing many XML files, one after one.
I think, this is synchronization problems.
To check this, just replace following source code for WRA\main.cpp file (from 321 line):
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);
To:
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;
}
}
And remove further source codes from the same Wrap::OpenTowerXML function (424, 428 lines):
Or use changed file from attached archive.
[Updated on: Fri, 23 March 2012 15:26] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Jun 15 23:51:16 CEST 2024
Total time taken to generate the page: 0.02365 seconds
|