Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Sender Ghost is currently offline  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):
delete[] pBuf;

Or use changed file from attached archive.

[Updated on: Fri, 23 March 2012 15:26]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Xmlize Null Color
Next Topic: how to check specific end tag in a xml file?
Goto Forum:
  


Current Time: Sat May 11 23:18:35 CEST 2024

Total time taken to generate the page: 0.01454 seconds