free XML parser after parsing
This commit is contained in:
parent
9e46e33c01
commit
afe815b69e
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue