问题很简单,可以概括为:
如何让这个while循环退出?
System.Windows.Media.MediaPlayer player = new System.Windows.Media.MediaPlayer();
WeakReference test = new WeakReference(player);
player.Close();
player = null;
while (test.IsAlive && test.Target != null)
{
System.GC.Collect();
}
我搜索了文档并发现无法处理此对象,while循环永远不会退出。