A destructor in C++ is a function that will be invoked when the object it is attached to is deleted (at the end of a procedure, or explicitly by a delete statement). Destructors can do any ``housecleaning'' necessary.