This problem occurs, if an array is initialized with the static initializer:
import std.gc;
extern(C) int printf( char*, ... );
class C{
~this(){
printf( "DTor()\n" );
}
}
C[] carr;
void setup(){
carr = [ new C, new C];
}
void main(){
setup();
fullCollect();
printf( "complete\n" );
}
// expected output
complete
DTor()
DTor()
// but it is
DTor()
DTor()
complete