C#XNA奇怪的错误

时间:2011-05-20 01:19:32

标签: c# .net xna

我搜索谷歌没有运气,也许有人可以提供帮助,因为我真的不想在MSDN上注册。

每次我都会遇到这种崩溃,我不太确定是什么导致它。

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.
}

1 个答案:

答案 0 :(得分:1)

  1. 由于您偶尔会说,有时候在此处置后有时会运行Update / Draw调用吗?

  2. 您确定Content.Load没有加载这些内容吗?根据这些名称的外观,它们看起来确实看起来像内容管理器

  3. 可能加载的游戏资产