www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.mmfile is broken

reply "Freddy" <Hexagonalstar64 gmail.com> writes:
The garbage collector is not required to call class destructors, 
but Mmfile is a class and could leak memory.
http://dlang.org/phobos/std_mmfile.html
May 05 2015
next sibling parent "Liam McSherry" <mcsherry.liam gmail.com> writes:
On Tuesday, 5 May 2015 at 19:53:51 UTC, Freddy wrote:
 The garbage collector is not required to call class 
 destructors, but Mmfile is a class and could leak memory.
 http://dlang.org/phobos/std_mmfile.html
This would probably be better reported as a bug using the issue tracker: https://issues.dlang.org/
May 05 2015
prev sibling parent "tcak" <tcak gmail.com> writes:
On Tuesday, 5 May 2015 at 19:53:51 UTC, Freddy wrote:
 The garbage collector is not required to call class 
 destructors, but Mmfile is a class and could leak memory.
 http://dlang.org/phobos/std_mmfile.html
As far as I know, when a process is terminated, its file handlers are removed by operating system automatically. Since, in destructor method, it only closes the file, even destructor is not called by the GC, it won't be a problem. Also, how else do you think the file will be closed other than destructor? Either it should be done manually, or by destructor.
May 05 2015