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 (...) { \ }