aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cache/cachedisklayer.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2024-11-08 15:27:08 +0100
committerGitHub Enterprise <[email protected]>2024-11-08 15:27:08 +0100
commit2cd52c9ff3a3fa09aad7d35bbab8b9bbc86d2498 (patch)
treea3d2e1c4f091a36350b18c450f160dd848c5f3a5 /src/zenstore/cache/cachedisklayer.cpp
parent5.5.10 (diff)
downloadzen-2cd52c9ff3a3fa09aad7d35bbab8b9bbc86d2498.tar.xz
zen-2cd52c9ff3a3fa09aad7d35bbab8b9bbc86d2498.zip
memory leak fix (GetBatchHandle) (#215)
This fixes a memory leak which would cause stale handles to accumulate until process shutdown. Each cache get operation would therefore leak some memory.
Diffstat (limited to 'src/zenstore/cache/cachedisklayer.cpp')
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index 8c93d8a3a..4aafb9828 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -1313,6 +1313,8 @@ struct ZenCacheDiskLayer::CacheBucket::GetBatchHandle
ResultIndexes.reserve(OutResults.capacity());
}
+ ~GetBatchHandle() {}
+
std::vector<IoHash> Keys;
std::vector<size_t> ResultIndexes;
@@ -1625,6 +1627,8 @@ ZenCacheDiskLayer::CacheBucket::EndGetBatch(GetBatchHandle* Batch) noexcept
}
}
}
+
+ delete Batch;
}
catch (const std::exception& Ex)
{