Index: ui/gl/gl_context_cgl.cc |
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc |
index 151c484d550f0d7b5f8062ffade0f670307d04a2..8caaf99ed496bfbdc9d8a573e8c2a79e12b70633 100644 |
--- a/ui/gl/gl_context_cgl.cc |
+++ b/ui/gl/gl_context_cgl.cc |
@@ -190,8 +190,9 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) { |
SetRealGLApi(); |
SetCurrent(surface); |
+ ScopedReleaseCurrent release_current(this, surface); |
+ |
if (!InitializeDynamicBindings()) { |
- ReleaseCurrent(surface); |
return false; |
} |
@@ -200,6 +201,7 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) { |
return false; |
} |
+ release_current.Release(); |
return true; |
} |