aboutsummaryrefslogtreecommitdiff
path: root/common/xmlparser.h
diff options
context:
space:
mode:
authorVicent Marti2008-09-29 10:27:16 +0000
committerVicent Marti2008-09-29 10:27:16 +0000
commitc8f42a39737dbd50cbdc4cad7c6a6c89ca0efe69 (patch)
tree0f49057fc5f141635c0658f5feef56331349b9e9 /common/xmlparser.h
parentf267d42080357b4ab697e04f325fe628a1f62c1f (diff)
downloadscummvm-rg350-c8f42a39737dbd50cbdc4cad7c6a6c89ca0efe69.tar.gz
scummvm-rg350-c8f42a39737dbd50cbdc4cad7c6a6c89ca0efe69.tar.bz2
scummvm-rg350-c8f42a39737dbd50cbdc4cad7c6a6c89ca0efe69.zip
Reduced memory usage by closing theme files after parsing. Could make things a tad slower.
svn-id: r34677
Diffstat (limited to 'common/xmlparser.h')
-rw-r--r--common/xmlparser.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/xmlparser.h b/common/xmlparser.h
index 7edabf62f3..967b73535b 100644
--- a/common/xmlparser.h
+++ b/common/xmlparser.h
@@ -222,6 +222,13 @@ public:
_fileName = "Compressed File Stream";
return true;
}
+
+ void close() {
+ if (_stream) {
+ delete _stream;
+ _stream = 0;
+ }
+ }
/**
* The actual parsing function.
@@ -361,7 +368,7 @@ protected:
break;
if (_char == 0)
- parserError("Comment has no closure.");
+ return parserError("Comment has no closure.");
}
_char = _stream->readByte();
return true;
@@ -449,7 +456,6 @@ protected:
Common::List<XMLKeyLayout*> _layoutList;
private:
- int _pos; /** Current position on the XML buffer. */
char _char;
SeekableReadStream *_stream;
Common::String _fileName;