Reduced memory usage by closing theme files after parsing. Could make things a tad slower.

svn-id: r34677
This commit is contained in:
Vicent Marti 2008-09-29 10:27:16 +00:00
parent f267d42080
commit c8f42a3973
3 changed files with 40 additions and 17 deletions

View file

@ -43,7 +43,7 @@ bool XMLParser::parserError(const char *errorString, ...) {
int lineStart = 0;
if (_fileName == "Memory Stream") {
lineStart = MAX(0, _pos - 35);
lineStart = MAX(0, original_pos - 35);
lineCount = 0;
} else {
do {
@ -51,7 +51,7 @@ bool XMLParser::parserError(const char *errorString, ...) {
lineCount++;
if (lineStart == 0)
lineStart = MAX(pos + 1, _pos - 60);
lineStart = MAX(pos + 1, original_pos - 60);
}
_stream->seek(-1, SEEK_CUR);
@ -210,7 +210,6 @@ bool XMLParser::parse() {
bool selfClosure = false;
_state = kParserNeedKey;
_pos = 0;
_activeKey.clear();
_char = _stream->readByte();