[Issue 9661] LockingTextWriter should increment file handle reference count

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Aug 13 09:14:11 PDT 2014


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

Justin Whear <justin at economicmodeling.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |justin at economicmodeling.com

--- Comment #1 from Justin Whear <justin at economicmodeling.com> ---
+1  I spent an hour in frustration because of a line like this:

auto buf = File("somefile", "w").lockingTextWriter();

Because the File is temporary, it immediately closes and leaves you with a
LockingTextWriter with a bad handle.  Since the whole point of wrapping FILE*
with File is to manage its lifetime, lockingTextWriter really needs to
increment and decrement the ref count.

--


More information about the Digitalmars-d-bugs mailing list