Managed DirectX, disposing resources

If objects dispose themselves in C#, do we ever need to explicitly dispose Pool.Default resources when the device is reset or Pool.Managed resources when the device is destroyed? If they dispose themselves, what are the OnLostDevice and OnDestroyDevice methods for?
[271 byte] By [chrouble] at [2008-2-21]
# 1

Its always best to manage the lifetime of Managed DirectX objects yourself for a couple of reasons.

  1. If you have the default even behaviour enabled everytime you create an object it will have events attached to it and will therefore never actually dispose itself. You will end up with an ever increasing memory requirement.
  2. You can't tell when an object will 'dispose itself'. When it is no longer in scope the GC will attempt to tidy it up at some point in the future. Normally this isn't too bad but in this case you are holding on to unmanaged resources. Also since most(all?) of the MDX objects have finalizers to ensure tidy up they will actually get disposed in the finalizer thread which means they survive at least on garbage collection and hang around even longer.
TheZMan at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...