From 245e705ac7b6fca80a7aa4898f5467053ec2c585 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Wed, 6 Mar 2013 11:43:16 +0000 Subject: Fix memory leak in trie. --- extractor/matchings_trie.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'extractor/matchings_trie.cc') 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 root) { for (auto child: root->children) { ResetTree(child.second); } + if (root->suffix_link != NULL) { + root->suffix_link.reset(); + } root.reset(); } } -- cgit v1.2.3