[Issue 19317] dip1008 doesn't call the throwable's destructor in _d_delThrowable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 20 15:58:52 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19317

--- Comment #2 from Nicholas Wilson <iamthewilsonator at hotmail.com> ---
Hmm, the actual problem seems to be that _d_delThrowable takes a Throwable [1]
(N.B: not the most derived type) and after checking its not null, is ref
counted, and `GC.removeRange(t);`ing if necessary, proceeds to call rt_finalize
on it[2], which recursively calls the destructors of t and is parent classes
(i.e. Throwable and Object) but misses any derived destructors.

[1]: https://github.com/dlang/druntime/blob/master/src/rt/ehalloc.d#L76
[2]: https://github.com/dlang/druntime/blob/master/src/rt/ehalloc.d#L114

--


More information about the Digitalmars-d-bugs mailing list