free XML parser after parsing

This commit is contained in:
Jindřich Makovička 2012-05-13 10:03:08 +02:00
parent 9e46e33c01
commit afe815b69e

View file

@ -379,6 +379,8 @@ void RenderingRulesStorage::parseRulesFromXmlInputStream(const char* filename, R
FILE *file = fopen(filename, "r");
if (file == NULL) {
osmand_log_print(LOG_ERROR, "File can not be open %s", filename);
XML_ParserFree(parser);
delete handler;
return;
}
char buffer[512];
@ -391,6 +393,8 @@ void RenderingRulesStorage::parseRulesFromXmlInputStream(const char* filename, R
}
if (XML_Parse(parser, buffer, len, done) == XML_STATUS_ERROR) {
fclose(file);
XML_ParserFree(parser);
delete handler;
return;
}
}
@ -429,6 +433,8 @@ void RenderingRulesStorage::parseRulesFromXmlInputStream(const char* filename, R
}
}
XML_ParserFree(parser);
delete handler;
fclose(file);
}