From 879654ea62effa64da7d7b4adc4b838a36f410e7 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 10 Jan 2018 15:54:10 +1300 Subject: [PATCH] Call ParseFinalize() from yyParser's destructor --- xapian-core/queryparser/queryparser.lt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xapian-core/queryparser/queryparser.lt b/xapian-core/queryparser/queryparser.lt index d647bf753..bb39d7feb 100644 --- a/xapian-core/queryparser/queryparser.lt +++ b/xapian-core/queryparser/queryparser.lt @@ -211,6 +211,7 @@ struct yyStackEntry { }; static void ParseInit(yyParser *pParser); +static void ParseFinalize(yyParser *pParser); /* The state of the parser is completely contained in an instance of ** the following structure */ @@ -226,6 +227,9 @@ struct yyParser { yyParser() { ParseInit(this); } + ~yyParser() { + ParseFinalize(this); + } }; typedef struct yyParser yyParser; @@ -395,10 +399,6 @@ static void ParseFree( yyParser *pParser /* The parser to be deleted */ ){ -#ifndef YYPARSEFREENEVERNULL - if( pParser==0 ) return; -#endif - ParseFinalize(pParser); delete pParser; } #endif /* Parse_ENGINEALWAYSONSTACK */ -- 2.11.4.GIT