[Libreoffice-commits] core.git: vcl/source
Michael Stahl
mstahl at redhat.com
Wed Sep 30 09:29:57 PDT 2015
vcl/source/opengl/OpenGLContext.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 5efad73918152f380fa1bf1e2cd3bc06b6353683
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Sep 30 18:25:45 2015 +0200
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
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 1aab588..c44b95b 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;
}
More information about the Libreoffice-commits
mailing list