2011-05-20 91 views
1

我已经搜索谷歌没有这个运气,也许这里有人可以帮助,因为我真的不想注册在MSDN上。C#新浪微博奇怪的错误

我现在每次都会碰到这个事故,我不太清楚是什么原因造成的。

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 
at Microsoft.Xna.Framework.Graphics.DeviceResourceManager.ReleaseAllReferences(UInt64 handle, Boolean dispose) 
at Microsoft.Xna.Framework.Graphics.DepthStencilBuffer.ReleaseNativeObject(Boolean disposeManagedResource) 
at Microsoft.Xna.Framework.Graphics.DepthStencilBuffer.!DepthStencilBuffer() 
at Microsoft.Xna.Framework.Graphics.DepthStencilBuffer.Dispose(Boolean) 
at Microsoft.Xna.Framework.Graphics.DepthStencilBuffer.Finalize()} 

使用VS2008,C#和XNA 3.1。

编辑:这是处置代码

protected override void UnloadContent() 
{ 
    // TODO: Unload any non ContentManager content here 
    TileSet.Dispose(); // Tileset is no longer needed. 
    blanksqaure.Dispose(); // Just for testing. 
    Logo.Dispose(); //D ispose logo. 
    AudioSystem.Dispose(); // Unload Audio System. 
} 
+0

需要看到一些代码.... – 2011-05-20 01:22:04

+0

,由于代码已经达到15000行有点艰苦的比赛资产。 – JDJD 2011-05-20 01:37:47

+0

由于GC产生的错误,我们可以看到您的配置代码吗? – soandos 2011-05-20 01:46:26

回答

1
  1. 既然你说偶然,是有一个机会,有时是更新/绘制调用后,该处理运行?

  2. 您确定这些不是由Content.Load加载的?通过这些名字的长相,他们肯定不看起来像可能是由内容管理器加载