News:

How did you even find this place?

Main Menu

Neat garbage collection in Microsoft XNA

Started by MyndFyre, September 07, 2006, 10:00:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MyndFyre

http://blogs.msdn.com/shawnhar/archive/2006/09/06/743437.aspx

Over the past year working on my WoW bot, I've run into similar types of questions (when should an object be finalized?  When should I let the garbage collector know when I'm done with my BLP image?)  Microsoft came up and delivered on a great system for this with the IDisposable interface, but just like the blog points out, that's not always an acceptable alternative when objects don't directly own an unmanaged resource (for example, a fully managed object that is an aggregate of unmanaged object wrappers).

Rather, the ContentManager class takes care of all of your content in one fell swoop.  And because content can be hierarchical (much like a binary space partitioned level, for instance), and because there can be multiple ContentManager objects, it's much easier to track this content.

Good times :)
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.