Index: ui/gl/gl_context_wgl.cc |
diff --git a/ui/gl/gl_context_wgl.cc b/ui/gl/gl_context_wgl.cc |
index 41f1b6349e027c24fedf7a190db21e0b2bda93db..abe47e4f9f7a78be1c32d3c02689e191314ce344 100644 |
--- a/ui/gl/gl_context_wgl.cc |
+++ b/ui/gl/gl_context_wgl.cc |
@@ -74,6 +74,7 @@ bool GLContextWGL::MakeCurrent(GLSurface* surface) { |
if (IsCurrent(surface)) |
return true; |
+ ScopedReleaseCurrent release_current; |
TRACE_EVENT0("gpu", "GLContextWGL::MakeCurrent"); |
if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) { |
@@ -86,7 +87,6 @@ bool GLContextWGL::MakeCurrent(GLSurface* surface) { |
SetCurrent(surface); |
if (!InitializeDynamicBindings()) { |
- ReleaseCurrent(surface); |
return false; |
} |
@@ -95,6 +95,7 @@ bool GLContextWGL::MakeCurrent(GLSurface* surface) { |
return false; |
} |
+ release_current.Cancel(); |
return true; |
} |