Skip to content

hClose not being called #459

Open
Open
@msrdic

Description

@msrdic

Hi – I've discovered this one by mistakenly calling my tool in the wrong folder.

hClose is not being called after Language.Haskell.Exts.parseFile is done. It can result in too many files open error.

I've identified two places where file content is being read and hClose is not being called, the first one being the one described above, and the second one in a test runner (test/Runner.hs).

Steps to reproduce: the way I discovered this is by recursively calling parseFile on a complete source tree for the folder where I keep my source code.
Possible fix: I've verified in my own fork that a combination of a strict hGetContents and hClose works well. It can either be done by System.IO.Strict.hGetContents or by just copying this short implementation to keep the list of dependencies shorter.

I am happy to submit a pull request, assuming this is a valid issue and I am not completely off target or missing something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions