如果我在公共类中声明这样的静态队列:
public class c
{
private string[] s={"a","b","c"};
private static Queue<string> q = new Queue<string>(s);
static private void SomeMethod()
{
private string[] s2 = {"123","345"};
// somewhere in here I reassign the queue q = new Queue<string>(s2);
}
}
我的操作会导致 C# 中的内存泄漏吗?垃圾收集会收回可能未使用的内存吗?