[Issue 3424] Ref counting still doesn't work for std.stdio.File

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 20 13:03:23 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3424


Andrei Alexandrescu <andrei at metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrei at metalanguage.com
         Resolution|                            |FIXED


--- Comment #1 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-10-20 13:03:22 PDT ---
(In reply to comment #0)
> If this can't be fixed in short order it should at least be documented so that
> people don't rely on the ref counting and auto closing.  Here's a test case to
> show it doesn't work.  This fails on both Windows and Linux.
> 
> import std.stdio, std.file;
> 
> void main() {
>     std.file.write("foo.txt", "stuff");
>     foreach(i; 0..1_000_000) {
>         openStuff();  // Throws too many files error rather quickly.
>     }
> }
> 
> void openStuff() {
>     File myFile = File("foo.txt");
>     // Not automatically closed.
> }

I'm glad to report I just fixed this and committed stdio.d.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list