summaryrefslogtreecommitdiff
path: root/extractor/matchings_trie.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-03-06 11:43:16 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-03-06 11:43:16 +0000
commit245e705ac7b6fca80a7aa4898f5467053ec2c585 (patch)
tree3034bcadfd9ed3778f1c89f5ea883270a3f64194 /extractor/matchings_trie.cc
parent6717daa034bfcfa429275f64d84607ae1568d488 (diff)
Fix memory leak in trie.
Diffstat (limited to 'extractor/matchings_trie.cc')
-rw-r--r--extractor/matchings_trie.cc3
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();
}
}