From 5fdeed2a166a3325a0e05beb986889751b9acb45 Mon Sep 17 00:00:00 2001 From: airborne12 Date: Wed, 19 Jun 2024 11:49:29 +0800 Subject: [PATCH] [Fix](index compaction) fix memory leak for index compaction (#224) (#226) --- src/core/CLucene/index/IndexWriter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/CLucene/index/IndexWriter.cpp b/src/core/CLucene/index/IndexWriter.cpp index 8bc3a934553..a3b30848af6 100644 --- a/src/core/CLucene/index/IndexWriter.cpp +++ b/src/core/CLucene/index/IndexWriter.cpp @@ -45,7 +45,10 @@ #define FINALLY_CLOSE_OUTPUT(x) \ try { \ - if (x != nullptr) x->close(); \ + if (x != nullptr) { \ + x->close(); \ + _CLDELETE(x) \ + } \ } catch (...) { \ }