2 Answers
2

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.

There is also a ContentManager.Unload(bool disposing) which is described as also unloading managed content if true. Are there xna content types in the xna library that are managed and need manual disposing?
–
WouterApr 18 '12 at 10:30

1

@Wouter Unload doesn't take an argument in any version I see on MSDN. You might be looking at Dispose(bool disposing) (which is a protected method, can't call externally). This is part of the standard C# disposable pattern (explained here). Dispose(true) gets called during standard disposal (the using statement or directly calling Dispose()) and will itself call Unload(). Dispose(false) gets called by the finalizer and specifically does not call Unload (it can't access other objects, they might have already been finalized).
–
Andrew RussellApr 21 '12 at 15:27