[Issue 11357] Weird behavior of appender with File as the element... do not know exactly where the bug resides.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 25 16:21:05 PDT 2013


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



--- Comment #4 from Phil Lavoie <maidenphil at hotmail.com> 2013-10-25 16:21:01 PDT ---
(In reply to comment #3)
> Issue is in appender, that doesn't properlly construct objects when inserting
> them, it merely assign them.
> 
> There is an existing pull that already fixes this:
> https://github.com/D-Programming-Language/phobos/pull/1529
> 
> That said, putting things with destructors (such as File) is a *terrible* idea,
> as things put inside dynamic arrays are never "finalized" (destroyed). So
> basically, you'll never close your files.
> 
> Prefer using std.container.Array: Not only does this correctly construct your
> objects, it will also deterministically manage their lifecycle.
> 
> TY for filing the issue.

Good to know regarding the never finalized objects/structs. I am thankful for
this information. I will give std.container.Array a try, thank you!

Phil

-- 
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