Use SafeRelease and SafeDelete to make sure released objects are NULL and will cause proper errors if referenced again.

TRAC #23617

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Geoff Lang
diff --git a/src/libGLESv2/renderer/ShaderCache.h b/src/libGLESv2/renderer/ShaderCache.h
index 4391ac2..084c6ff 100644
--- a/src/libGLESv2/renderer/ShaderCache.h
+++ b/src/libGLESv2/renderer/ShaderCache.h
@@ -53,7 +53,7 @@
         // Random eviction policy.
         if (mMap.size() >= kMaxMapSize)
         {
-            mMap.begin()->second->Release();
+            SafeRelease(mMap.begin()->second);
             mMap.erase(mMap.begin());
         }
 
@@ -67,7 +67,7 @@
     {
         for (typename Map::iterator it = mMap.begin(); it != mMap.end(); ++it)
         {
-            it->second->Release();
+            SafeRelease(it->second);
         }
 
         mMap.clear();