Take a look at my answers here and possibly here.
The ContentManager
"owns" all the content that it loads and is responsible for unloading it. The only way you should unload content that a ContentManager has loaded is by using ContentManager.Unload()
(MSDN).
If you are not happy with this default behaviour of ContentManager, you can replace it as described in this blog post.
Any textures or other unload-able resources that you create yourself without going through ContentManager
should be disposed (by calling Dispose()
) in your Game.UnloadContent
function.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…