Index: ui/gl/gl_context_osmesa.cc |
diff --git a/ui/gl/gl_context_osmesa.cc b/ui/gl/gl_context_osmesa.cc |
index e7ccba99039c116727f7c9f4061ad6adea717c0e..28172f7b17e8ceefbd5a3edbd4b94dc7af9ae01e 100644 |
--- a/ui/gl/gl_context_osmesa.cc |
+++ b/ui/gl/gl_context_osmesa.cc |
@@ -69,8 +69,9 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) { |
OSMesaPixelStore(OSMESA_Y_UP, 0); |
SetCurrent(surface); |
+ ScopedReleaseCurrent release_current(this, surface); |
+ |
if (!InitializeDynamicBindings()) { |
- ReleaseCurrent(surface); |
return false; |
} |
@@ -79,6 +80,7 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) { |
return false; |
} |
+ release_current.Release(); |
return true; |
} |