April 24, 2004 Re: [BUG] gc & static & templates | ||||
---|---|---|---|---|
| ||||
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 Re: [BUG] gc & static & templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sark7 | 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
|
Copyright © 1999-2021 by the D Language Foundation