Using Dispose on a Singleton to Cleanup Resources
问题 The question I have might be more to do with semantics than with the actual use of IDisposable . I am working on implementing a singleton class that is in charge of managing a database instance that is created during the execution of the application. When the application closes this database should be deleted. Right now I have this delete being handled by a Cleanup() method of the singleton that the application calls when it is closing. As I was writing the documentation for Cleanup() it