diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-03-06 11:43:16 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-03-06 11:43:16 +0000 |
commit | 245e705ac7b6fca80a7aa4898f5467053ec2c585 (patch) | |
tree | 3034bcadfd9ed3778f1c89f5ea883270a3f64194 /extractor/matchings_trie.cc | |
parent | 6717daa034bfcfa429275f64d84607ae1568d488 (diff) |
Fix memory leak in trie.
Diffstat (limited to 'extractor/matchings_trie.cc')
-rw-r--r-- | extractor/matchings_trie.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extractor/matchings_trie.cc b/extractor/matchings_trie.cc index 921ec582..8ea795db 100644 --- a/extractor/matchings_trie.cc +++ b/extractor/matchings_trie.cc @@ -14,6 +14,9 @@ void MatchingsTrie::ResetTree(shared_ptr<TrieNode> root) { for (auto child: root->children) { ResetTree(child.second); } + if (root->suffix_link != NULL) { + root->suffix_link.reset(); + } root.reset(); } } |