J
Julie
Does anyone know why the Finalize method (if present) isn't called immediately
after the instance refcount is set to 0?
It seems to me, that if it were, it would solve at least two issues:
- simplify the garbage collector (according to the documentation, the GC is
internally run twice)
- do away with a lot of /using/ code dealing w/ instances that wrap
externally accessible resources (files through StreamReader is a good example)
If Finalize was immediately called, objects like StreamReader could close open
handles w/o relying on the programmer to either specifically close or use
using, and it would simplify the GC internally.
Comments?
after the instance refcount is set to 0?
It seems to me, that if it were, it would solve at least two issues:
- simplify the garbage collector (according to the documentation, the GC is
internally run twice)
- do away with a lot of /using/ code dealing w/ instances that wrap
externally accessible resources (files through StreamReader is a good example)
If Finalize was immediately called, objects like StreamReader could close open
handles w/o relying on the programmer to either specifically close or use
using, and it would simplify the GC internally.
Comments?