From 73bdd5a7a43c6bf034267896eb8905ca7a2d083c Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 16 Dec 2021 11:41:31 +1100 Subject: [PATCH] Fix leaked mmap storage in test --- issue211_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/issue211_test.go b/issue211_test.go index 5d93d1f2..7794f8a5 100644 --- a/issue211_test.go +++ b/issue211_test.go @@ -26,8 +26,10 @@ func TestDropTorrentWithMmapStorageWhileHashing(t *testing.T) { defer cl.Close() td, mi := testutil.GreetingTestTorrent() + mms := storage.NewMMap(td) + defer mms.Close() tt, new, err := cl.AddTorrentSpec(&TorrentSpec{ - Storage: storage.NewMMap(td), + Storage: mms, InfoHash: mi.HashInfoBytes(), InfoBytes: mi.InfoBytes, })