import std.stdio; struct S { ~this() { writefln("die!"); } void fun(){} } S fun() { return S(); } int main(char[][] args) { fun().fun(); ... return 0; } Struct's destructor not called .
*** This issue has been marked as a duplicate of issue 3516 ***