summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 1aab588565f1..c44b95b887e8 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -879,14 +879,22 @@ bool OpenGLContext::ImplInit()
}
if (!InitGLEW())
+ {
+ wglMakeCurrent(NULL, NULL);
+ wglDeleteContext(hTempRC);
return false;
+ }
HGLRC hSharedCtx = 0;
if (!g_vShareList.empty())
hSharedCtx = g_vShareList.front();
if (!wglCreateContextAttribsARB)
+ {
+ wglMakeCurrent(NULL, NULL);
+ wglDeleteContext(hTempRC);
return false;
+ }
// now setup the shared context; this needs a temporary context already
// set up in order to work
@@ -902,6 +910,8 @@ bool OpenGLContext::ImplInit()
{
ImplWriteLastError(GetLastError(), "wglCreateContextAttribsARB in OpenGLContext::ImplInit");
SAL_WARN("vcl.opengl", "wglCreateContextAttribsARB failed");
+ wglMakeCurrent(NULL, NULL);
+ wglDeleteContext(hTempRC);
return false;
}