]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix leaked mmap storage in test v1.39.2
authorMatt Joiner <anacrolix@gmail.com>
Thu, 16 Dec 2021 00:41:31 +0000 (11:41 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 16 Dec 2021 03:19:21 +0000 (14:19 +1100)
issue211_test.go

index 5d93d1f24650e7252045d69a49d96006c45f7d0c..7794f8a50137974993485f57d1a14f30f3d5a913 100644 (file)
@@ -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,
        })