mono/MonoGame — pull request #989 by Aranda (2012-11-14 16:37:10+00:00)
Title: Fix GL related exception on Android after multiple resumes (988)

This should resolve https://github.com/mono/MonoGame/issues/988

The issue arose from the static list `GraphicsResource.resources` being cleared when the devices was reset. During the second reset, the shader resources weren't in the list so they couldn't be invalidated. Since most of these resources would survive the reset, they shouldn't be cleared. Instead the list is pruned of expired (ie garbage collected) weak references.

Also improved a comment and tightened the GL error checking from logging to exceptions in ShaderProgramCache. It seems that if ever these errors were logged, the program could not recover and it would fail a subsequent error check anyway.