开发者

C# XNA Weird error

I've search google with no luck on this, maybe someone here could help 开发者_开发问答as I really don't want to sign up on MSDN.

Every now and again I'll get this crash, I am not too sure what causes it.

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()}

Using VS2008, C#, and XNA 3.1.

Edit: Here is the dispose code

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. Since you say occasionally, is there a chance that sometimes an Update/Draw call runs after this dispose?

  2. Are you sure these are not loaded by Content.Load? By the looks of these names, they sure do look like game assets probably loaded by Content manager

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜