With GC you usually have two destructors: one for managed resources and one for unmanaged resources. Destructor for managed resources should be run on live objects as soon as you don't need the resource, it calls unmanaged destructor too. Unmanaged destructor (finalizer) is called by GC during garbage collection and frees unmanaged resources (not managed by GC). Since they are not managed by GC, you decide, how they are disposed. Though calling finalizer during collection is a last resort for resource management, unmanaged destructor should be normally called from managed destructor.

Reply via email to