summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-30 18:25:45 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-30 18:28:22 +0200
commit5efad73918152f380fa1bf1e2cd3bc06b6353683 (patch)
tree8b6932fcf41ce319dabb50835097a592a22e4b38
parent08ba2b2886c98b9c9d33e66a527c062b1b6b1d37 (diff)
vcl: clean up before error returns in OpenGLContext::ImplInit()
JunitTest_chart_unoapi fails here with "assert(!hasCurrent())" because the initialization apparently fails due to lack of a wglCreateContextAttribsARB in the VM, so ensure that the hTempRC is not active and also deleted in all cases. Change-Id: I7e03b95d1146af48a24e34692c3c2827298fccee
-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;
}