Fix a memory leak introduced in the last release
authorJoey Hess <joeyh@joeyh.name>
Tue, 13 Oct 2020 20:31:01 +0000 (16:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 13 Oct 2020 20:31:01 +0000 (16:31 -0400)
commit9a5cd96f0dd0593dd0c62f084c90898baa92ba1d
tree5a5084b09bdc30766487a749cbc7644bfa0b1f3e
parentc703c6f2950905e90b8187c76e4c4d18b82cccf1
Fix a memory leak introduced in the last release

The problem was this line:

cleanup = and <$> sequence (map snd v)

That caused all of v to be held onto until the end, when the cleanup action
was run.

I could not seem to find a bang pattern that avoided the leak, so I
resorted to a IORef, rather clunky, but not a performance problem because
it will only be written once per git ls-files, so typically just 1 time.

This commit was sponsored by Mark Reidenbach on Patreon.
CHANGELOG
CmdLine/Seek.hs
Utility/Path.hs
doc/todo/memory_use_increase/comment_8_244acef6b20ac8fc281372f0898a49be._comment [new file with mode: 0644]