[英]C# XNA Weird error
我搜索Google時沒有運氣,也許有人在這里可以提供幫助,因為我真的不想在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.
}
既然您偶爾說,在處理后有時是否有運行Update / Draw調用的機會?
您確定這些不是由Content.Load加載的嗎? 從這些名稱的外觀來看,它們肯定看起來像內容管理器可能加載的游戲資產
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.