Static member variables ever garbage collect?
For example, you can use the following class.
public class HasStatic { private static List<string> shared = new List<string>(); }
And suggested that he used like this:
//Startup { HasStatic a = new HasStatic(); HasStatic b = new HasStatic(); HasStatic c = new HasStatic(); HasStatic d = new HasStatic(); //Something } //Other code //Things deep GC somewhere in here HasStatic e = new HasStatic();
When a , b , c and d are garbage collected, is the static shared member going? Can e get a new instance of shared ?
garbage-collection c # static-members
C. Ross Jul 06 '11 at 16:50 2011-07-06 16:50
source share