【发布时间】:2012-09-11 15:44:39
【问题描述】:
如果我在公共类中声明这样的静态队列:
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# 中的内存泄漏吗?垃圾回收会收回可能未使用的内存吗?
【问题讨论】:
标签: c# memory-leaks