You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Field destructor not called for extern(C++) class without explicit destructor #22942
importstd.stdio;
extern(C++):
structS
{
~this()
{
writeln("S.~this");
}
}
classA
{
~this()
{
writeln("A.~this");
}
}
classB : A
{
S s;
}
voidmain()
{
A x = new B;
x.destroy();
}
It only runs the destructor for A and does not run the destructor for S, because B has no explicit destructor. This probably happens, because cppDtorVtblIndex not set (-1) for class B. See
Activity
Fix dlang#22942 - Field destructor not called for extern(C++) class