[Issue 13059] New: Delete uses destructor rather than the delete operator
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 6 12:58:22 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13059
Issue ID: 13059
Summary: Delete uses destructor rather than the delete operator
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: blah38621 at gmail.com
Currently, if you define a destructor on a struct, allocate an instance of that
struct on the heap, and then attempt to use the delete keyword to destroy and
then free the memory, it will instead only call the destructor, just as-if you
had defined a delete operator, this is not mentioned in the spec, and was only
noticed because it caused double finalization when I added support to the GC
for calling struct's destructors.
--
More information about the Digitalmars-d-bugs
mailing list