From b8c7594dbf422878d167411ae635ceeb890034d7 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Tue, 6 Dec 2022 22:46:25 -0500 Subject: [PATCH] Release the chunk used to download files when finished Without this fix, a chunk is leaked for each snapshot checked with `-files`. --- src/duplicacy_snapshotmanager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/duplicacy_snapshotmanager.go b/src/duplicacy_snapshotmanager.go index 1a94f09..9504547 100644 --- a/src/duplicacy_snapshotmanager.go +++ b/src/duplicacy_snapshotmanager.go @@ -1338,6 +1338,10 @@ func (manager *SnapshotManager) VerifySnapshot(snapshot *Snapshot) bool { LOG_TRACE("SNAPSHOT_VERIFY", "%s", file.Path) } + if lastChunk != nil { + manager.config.PutChunk(lastChunk) + } + if corruptedFiles > 0 { LOG_WARN("SNAPSHOT_VERIFY", "Snapshot %s at revision %d contains %d corrupted files", snapshot.ID, snapshot.Revision, corruptedFiles)