From: Matt Joiner Date: Thu, 16 Dec 2021 00:41:31 +0000 (+1100) Subject: Fix leaked mmap storage in test X-Git-Tag: v1.39.2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=73bdd5a7a43c6bf034267896eb8905ca7a2d083c;p=btrtrc.git Fix leaked mmap storage in test --- 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, })