April 24, 2004
Also, in the following program dtor is not called.

[code]
template TFoo(T) {
  T t;
}

class C {
  this() {
    printf("ctor"\n);
  }
  ~this() {
    printf("dtor"\n);
  }
}

void main() {
  TFoo!(C).t = new C();	
}
[/code]
April 25, 2004
Sark7 wrote:
> Also, in the following program dtor is not called.
[snip]

The template stuff is unneccesary, this is all part of the same behavior -- globally alloacted class cleanup is not happening; it's being passed off to the OS. This is a problem for globally allocated classes that somehow indicate closing state in their dtors rather than just releasing memory.

Walter, is it the case that global class instances should have their dtors called at program termination?

Cheers,
  Craig