From 26a36d3750320f2327ce0ec5e42fee71b60c8bd0 Mon Sep 17 00:00:00 2001 From: Michal Zimonczyk Date: Tue, 10 Mar 2026 14:19:15 +0100 Subject: [PATCH] Fix memory leak in QuadTreeIndex Thread local instance of MemoryPoolAllocator kept memory allocated for previous documents and grew during runtime. Relates-To: HNAV-13357 Signed-off-by: Michal Zimonczyk --- .../src/repositories/QuadTreeIndex.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/olp-cpp-sdk-dataservice-read/src/repositories/QuadTreeIndex.cpp b/olp-cpp-sdk-dataservice-read/src/repositories/QuadTreeIndex.cpp index 6f9b30088..53dcb75bb 100644 --- a/olp-cpp-sdk-dataservice-read/src/repositories/QuadTreeIndex.cpp +++ b/olp-cpp-sdk-dataservice-read/src/repositories/QuadTreeIndex.cpp @@ -101,9 +101,7 @@ QuadTreeIndex::QuadTreeIndex(const cache::KeyValueCache::ValueTypePtr& data) { QuadTreeIndex::QuadTreeIndex(const geo::TileKey& root, int depth, std::stringstream& json_stream) { - thread_local rapidjson::CrtAllocator crt_allocator; - thread_local rapidjson::MemoryPoolAllocator<> pool_allocator; - rapidjson::Document doc(&pool_allocator, 4096, &crt_allocator); + rapidjson::Document doc; rapidjson::IStreamWrapper stream(json_stream); doc.ParseStream(stream);