import std.stdio; __gshared Foo foo; class Foo { ~this() { writeln("Release Foo"); } } void main() { foo = new Foo; } OTOH the dtor gets properly called if it's a thread-local instance. Is this a known bug?
__gshared variables go into the data segment (.BSS), and according to the docs: "Objects referenced from the data segment never get collected by the gc." (http://dlang.org/class.html). TLS class objects go to the .tls section and get collected.