Author Topic: Neat garbage collection in Microsoft XNA  (Read 2165 times)

0 Members and 1 Guest are viewing this topic.

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Neat garbage collection in Microsoft XNA
« on: September 07, 2006, 10:00:57 pm »
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 :)
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.