OpenRA/OpenRA — pull request #5923 by RoosterDragon (2014-07-10 19:32:36+00:00)
Title: Dispose of graphics resources deterministically

Speculative fix for #5116 by implementing IDisposable on Texture, FrameBuffers and VertexBuffer rather than relying on the finalizer to do the work since the non-determinism of finalization means these resources could be hanging around for an unbounded length of time before being released.

This PR ensures almost all of these resources are released deterministically via Dispose (a few stragglers still get finalized since some lifetimes are non-trivial, particularly with textures for sheets allocated by sheet builders, which makes tracking them down difficult).

I don't have any particular proof that this will fix the out-of-memory issue, it just seems like it could be a possible cause.