Fix leaked mmap storage in test

This commit is contained in:
Matt Joiner 2021-12-16 11:41:31 +11:00
parent 12c77bc410
commit 73bdd5a7a4
1 changed files with 3 additions and 1 deletions

View File

@ -26,8 +26,10 @@ func TestDropTorrentWithMmapStorageWhileHashing(t *testing.T) {
defer cl.Close() defer cl.Close()
td, mi := testutil.GreetingTestTorrent() td, mi := testutil.GreetingTestTorrent()
mms := storage.NewMMap(td)
defer mms.Close()
tt, new, err := cl.AddTorrentSpec(&TorrentSpec{ tt, new, err := cl.AddTorrentSpec(&TorrentSpec{
Storage: storage.NewMMap(td), Storage: mms,
InfoHash: mi.HashInfoBytes(), InfoHash: mi.HashInfoBytes(),
InfoBytes: mi.InfoBytes, InfoBytes: mi.InfoBytes,
}) })