Don: > As far as I can tell, the use cases for finalizers are very limited. To > me, destructors don't make any sense unless they are deterministic. > For example, I think having a File class is probably a bug. You may be > on a system which has no limit on the number of file handles, but > generally, if you need resource management, you need a guarantee that > the destructor will be called.
This seems similar to what I have written before: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=115028 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=115057 But if the purpose of a destructor is just to help/speedup the deallocation of a RAM resource (like to nullify the links of a tree to speed up the job of the GC) then in my opinion it is acceptable for this destructor to not run deterministically. Bye, bearophile