diff options
| author | Stefan Boberg <[email protected]> | 2024-11-08 15:27:08 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-11-08 15:27:08 +0100 |
| commit | 2cd52c9ff3a3fa09aad7d35bbab8b9bbc86d2498 (patch) | |
| tree | a3d2e1c4f091a36350b18c450f160dd848c5f3a5 /src | |
| parent | 5.5.10 (diff) | |
| download | zen-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')
| -rw-r--r-- | src/zenstore/cache/cachedisklayer.cpp | 4 |
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) { |