From: Anthony N. <ant...@gm...> - 2013-05-10 00:43:32
|
Dear All, I've detected some memory leaks using CLucene (version 2.3.3.4) and tracked this down to the reusableTokenStream interface of the StandardAnalyzer. The StandardAnalyzer::SavedStreams object which is allocated on the first call to reusableTokenStream is eventually deleted (using an Object AbstractDeletor) but it does not have a destructor. The solution was to add a destructor as follows: index 3275c1b..6836629 100644 --- a/clucene-core-2.3.3.4/src/core/CLucene/analysis/standard/StandardAnalyzer.cpp +++ b/clucene-core-2.3.3.4/src/core/CLucene/analysis/standard/StandardAnalyzer.cpp @@ -54,6 +54,11 @@ CL_NS_DEF2(analysis,standard) { } + ~SavedStreams() + { + _CLDELETE(filteredTokenStream); + } + void close(){} Token* next(Token* token) {return NULL;} }; Could this patch be reviewed and incorporated into the master? Thanks, Anthony |