Fixed memory leak

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5564 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-06-26 19:33:03 +00:00
parent 5f18162c25
commit 7db06e27e1

View File

@ -85,7 +85,6 @@ void Screen::loadFromFile()
{ {
assert(m_magic_number == 0xCAFEC001); assert(m_magic_number == 0xCAFEC001);
//FIXME: need to delete this pointer
IrrXMLReader* xml = irr::io::createIrrXMLReader( (file_manager->getGUIDir() + "/" + m_filename).c_str() ); IrrXMLReader* xml = irr::io::createIrrXMLReader( (file_manager->getGUIDir() + "/" + m_filename).c_str() );
parseScreenFileDiv(xml, m_widgets); parseScreenFileDiv(xml, m_widgets);
m_loaded = true; m_loaded = true;
@ -93,6 +92,8 @@ void Screen::loadFromFile()
// invoke callback so that the class deriving from Screen is aware of this event // invoke callback so that the class deriving from Screen is aware of this event
loadedFromFile(); loadedFromFile();
delete xml;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------