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");
|
FILE *file = fopen(filename, "r");
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
osmand_log_print(LOG_ERROR, "File can not be open %s", filename);
|
osmand_log_print(LOG_ERROR, "File can not be open %s", filename);
|
||||||
|
XML_ParserFree(parser);
|
||||||
|
delete handler;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
|
@ -391,6 +393,8 @@ void RenderingRulesStorage::parseRulesFromXmlInputStream(const char* filename, R
|
||||||
}
|
}
|
||||||
if (XML_Parse(parser, buffer, len, done) == XML_STATUS_ERROR) {
|
if (XML_Parse(parser, buffer, len, done) == XML_STATUS_ERROR) {
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
XML_ParserFree(parser);
|
||||||
|
delete handler;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -429,6 +433,8 @@ void RenderingRulesStorage::parseRulesFromXmlInputStream(const char* filename, R
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
XML_ParserFree(parser);
|
||||||
|
delete handler;
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue