I'm trying to load a simple XML file using TinyXml2 but it just crashes.
This is the contents of the file I'm trying to load :
<Texture Name='Grass' Path='Data/Textures/Grass.png'> </Texture>
My file structure looks like this :
Here's how I'm attempting to load the file :
XMLFile file;
file.LoadFile("Data/Textures/textures.xml");
XMLFile::LoadFile() is this :
bool XMLFile::LoadFile(const std::string& filePath)
{
if (mDocument->LoadFile(filePath.c_str()) != XML_SUCCESS)
{
gDebugger.PrintError(__FILE__, "Failed to load file : " + filePath + " from disk.");
return false;
}
return true;
}
mDocument is this in the header file :
tinyxml2::XMLDocument* mDocument;
It tells me that it crashed in tinyxml2.cpp on line 765 :
void XMLNode::DeleteChildren()
{
while( _firstChild ) { /* Crashes here */
TIXMLASSERT( _lastChild );
DeleteChild( _firstChild );
}
_firstChild = _lastChild = 0;
}
I can't understand what I'm doing wrong? :/