Notification function called immediately before an object is closed.
The default implementation of this function does nothing. This function can be overridden in custom classes.