https://issues.dlang.org/show_bug.cgi?id=14630

Boris Carvajal <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #1 from Boris Carvajal <[email protected]> ---
The problem is that MmFile is a class and the construct "cast(string)mapFile[]"
doesn't prevent the object from being collected.

Declaring the variable with scope

    scope mapFile = new MmFile(map_path);

or simply using it after the loop

    foreach(line ; splitter(cast(string)mapFile[], '\n'))
    {
       ...
    }
    mapFile.length;

makes the program succeed.

--

Reply via email to