<<< Destructor example | Index | References >>> |
The destructor will be called for any object at the end of its lifecycle
This provides the perfect opportunity to clean up
If your object does any dynamic resource allocation during its life, it should deallocate those resources in its destructor
Examples of resources deallocation could be:
freeing memory allocated with new
closing open files or devices
<<< Destructor example | Index | References >>> |