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.
- Destructor/Finalizer Gua... Maxime Chevalier-Boisvert via Digitalmars-d-learn
- Re: Destructor/Fina... ketmar via Digitalmars-d-learn
- Re: Destructor/Fina... Dicebot via Digitalmars-d-learn
- Re: Destructor/Fina... Dicebot via Digitalmars-d-learn
- Re: Destructor/Fina... Steven Schveighoffer via Digitalmars-d-learn
- Re: Destructor/Fina... Algo via Digitalmars-d-learn
- Re: Destructor/... thedeemon via Digitalmars-d-learn
- Re: Destructor/Fina... thedeemon via Digitalmars-d-learn
- Re: Destructor/Fina... Kagamin via Digitalmars-d-learn
- Re: Destructor/... eles via Digitalmars-d-learn
- Re: Destruc... Kagamin via Digitalmars-d-learn
- Re: Destruc... Kagamin via Digitalmars-d-learn