[Issue 15246] Destructor inheritance doesn't inherit attributes properly

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 27 08:46:35 PDT 2015


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

--- Comment #8 from Marco Leise <Marco.Leise at gmx.de> ---
We "finalize" them through the helper function `rt_finalize` mentioned earlier,
which calls the __dtor's in sequence and is the only place that also handles
destruction of the hidden "monitor" field if it was used. It is wrapped in
object.d as:

    void destroy(T)(T obj) if (is(T == class))
    {
        rt_finalize(cast(void*)obj);
    }

destroy() complete object finalization + memory reinitialized to .init
__xdtor   same as __dtor + destroys any RAII members
__dtor    the ~this() function as defined in the source
(That's how I remember it. May be inaccurate.)

--


More information about the Digitalmars-d-bugs mailing list