How and when to dispose/garbage collect a singleton instance
问题 I am using a Singleton instance created out of a nested class. This instance holds some static collections which are cleared when the Singleton is disposed, but the problem is I get a reference to non-null disposed Singleton which is not properly garbage collected. I would like to know WHEN and HOW to completely dispose and garbage collect my Singleton instance so that when the instance is queried again after dispose (and setting to null) a new Instance is created. I am using the following