Clear cached state when deleting GL objects.

Change-Id: I84eac9b3796858e5e19e26851ad83baa1f9b6af2
Reviewed-on: https://chromium-review.googlesource.com/269142
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/gl/RenderbufferGL.cpp b/src/libANGLE/renderer/gl/RenderbufferGL.cpp
index dcfd7bb..d1a2aa7 100644
--- a/src/libANGLE/renderer/gl/RenderbufferGL.cpp
+++ b/src/libANGLE/renderer/gl/RenderbufferGL.cpp
@@ -30,11 +30,8 @@
 
 RenderbufferGL::~RenderbufferGL()
 {
-    if (mRenderbufferID != 0)
-    {
-        mFunctions->deleteRenderbuffers(1, &mRenderbufferID);
-        mRenderbufferID = 0;
-    }
+    mStateManager->deleteRenderbuffer(mRenderbufferID);
+    mRenderbufferID = 0;
 }
 
 gl::Error RenderbufferGL::setStorage(GLenum internalformat, size_t width, size_t height)