- fixed a bunch of memory leaks that will hopefully mean less overall memory requirements.

This commit is contained in:
Mark Vejvoda
2011-09-28 06:57:42 +00:00
parent 59246056bc
commit aed293bba2
11 changed files with 161 additions and 33 deletions

View File

@@ -65,6 +65,8 @@ bool XmlIo::initialized= false;
XmlIo::XmlIo() {
try{
XMLPlatformUtils::Initialize();
XmlIo::initialized= true;
}
catch(const XMLException &e){
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error initializing XML system, msg %s\n",__FILE__,__FUNCTION__,__LINE__,e.getMessage());
@@ -83,13 +85,20 @@ XmlIo::XmlIo() {
}
}
XmlIo &XmlIo::getInstance(){
XmlIo &XmlIo::getInstance() {
static XmlIo XmlIo;
return XmlIo;
}
XmlIo::~XmlIo(){
XMLPlatformUtils::Terminate();
void XmlIo::cleanup() {
if(XmlIo::initialized == true) {
XmlIo::initialized= false;
XMLPlatformUtils::Terminate();
}
}
XmlIo::~XmlIo() {
cleanup();
}
XmlNode *XmlIo::load(const string &path, std::map<string,string> mapTagReplacementValues) {