From 0fd1b4ffacabee547b7355ae95e6f26f35b396a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E5=87=AF?= Date: Wed, 12 Jun 2024 21:09:37 +0800 Subject: [PATCH] [Fix](index compaction) fix memory leak for index compaction --- 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 (...) { \ }