Index: ui/gl/gl_context_nsview.mm |
diff --git a/ui/gl/gl_context_nsview.mm b/ui/gl/gl_context_nsview.mm |
index 8f38d08166d0a1fa8b08b08e9367456362f588cf..bc4a87b910bcb277c3429cf1de309106d5e21c53 100644 |
--- a/ui/gl/gl_context_nsview.mm |
+++ b/ui/gl/gl_context_nsview.mm |
@@ -55,6 +55,7 @@ void GLContextNSView::Destroy() { |
} |
bool GLContextNSView::MakeCurrent(GLSurface* surface) { |
+ ScopedReleaseCurrent release_current; |
TRACE_EVENT0("gpu", "GLContextNSView::MakeCurrent"); |
AcceleratedWidget view = |
static_cast<AcceleratedWidget>(surface->GetHandle()); |
@@ -67,7 +68,6 @@ bool GLContextNSView::MakeCurrent(GLSurface* surface) { |
SetRealGLApi(); |
SetCurrent(surface); |
if (!InitializeDynamicBindings()) { |
- ReleaseCurrent(surface); |
return false; |
} |
@@ -76,6 +76,7 @@ bool GLContextNSView::MakeCurrent(GLSurface* surface) { |
return false; |
} |
+ release_current.Cancel(); |
return true; |
} |