July 06, 2014 [Issue 13059] New: Delete uses destructor rather than the delete operator | ||||
---|---|---|---|---|
| ||||
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@puremagic.com Reporter: blah38621@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. -- |
Copyright © 1999-2021 by the D Language Foundation