digitalmars.D - std.mmfile is broken
- Freddy (3/3) May 05 2015 The garbage collector is not required to call class destructors,
- Liam McSherry (3/6) May 05 2015 This would probably be better reported as a bug using the issue
- tcak (7/10) May 05 2015 As far as I know, when a process is terminated, its file handlers
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
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.htmlThis would probably be better reported as a bug using the issue tracker: https://issues.dlang.org/
May 05 2015
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.htmlAs 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