[Issue 14868] MmFile destructor seems to corrupt memory

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Sep 1 00:04:26 PDT 2015


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

Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow at gmail.com

--- Comment #11 from Vladimir Panteleev <thecybershadow at gmail.com> ---
The problem here is that MmFile does not retain a copy of the File. As such,
the File will be closed at the end of that statement, as it was a temporary
that was never copied anywhere. The correct fix would be to add a private File
field to MmFile and make it save a copy of the File parameter.

--


More information about the Digitalmars-d-bugs mailing list