Skip to content
Snippets Groups Projects
Commit c88fce56 authored by ilor's avatar ilor
Browse files

fix memory leak in XcesReader and possibly other Readers

parent 90f81b2f
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,8 @@ Token* BufferedChunkReader::get_next_token()
if (s != NULL) {
std::copy(s->tokens().begin(), s->tokens().end(),
std::back_inserter(token_buf_));
s->tokens().clear();
delete s;
} else {
more = false;
}
......@@ -76,6 +78,8 @@ Sentence* BufferedChunkReader::get_next_sentence()
if (c != NULL) {
std::copy(c->sentences().begin(), c->sentences().end(),
std::back_inserter(sentence_buf_));
c->sentences().clear();
delete c;
} else {
more = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment