Search This Blog

Friday, August 27, 2010

Garbage collection

1. Allocate memory for the type that represents the resource.


2. Initialize the memory to set the initial state of the resource and to make the resource usable.

3. Use the resource by accessing the instance members of the type (repeat as necessary).

4. Tear down the state of the resource to clean up.

5. Free the memory.