From ed40c367fcc36abb67347d068d49080eabd56820 Mon Sep 17 00:00:00 2001 From: Dave Streeter Date: Fri, 7 Mar 2025 09:00:55 +0000 Subject: [PATCH] HPCC-33596 Fix possible double release of CLazyFileIOCache in Dali Prevent double release of CLazyFileIOCache in destructors Signed-off-by: Dave Streeter --- dali/ft/daftformat.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dali/ft/daftformat.cpp b/dali/ft/daftformat.cpp index a20c8700338..5fff5a03460 100644 --- a/dali/ft/daftformat.cpp +++ b/dali/ft/daftformat.cpp @@ -373,8 +373,9 @@ CriticalSection CInputBasePartitioner::openfilecachesect; CInputBasePartitioner::~CInputBasePartitioner() { inStream.clear(); - if (openfilecache) { - CriticalBlock block(openfilecachesect); + CriticalBlock block(openfilecachesect); + if (openfilecache) + { if (openfilecache->Release()) openfilecache = NULL; } @@ -1704,8 +1705,9 @@ CJsonInputPartitioner::~CJsonInputPartitioner() { json.clear(); inStream.clear(); - if (openfilecache) { - CriticalBlock block(openfilecachesect); + CriticalBlock block(openfilecachesect); + if (openfilecache) + { if (openfilecache->Release()) openfilecache = NULL; }