This method should be called to close all open views of the object and to free all allocated resources.