summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-20 02:04:52 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-20 12:03:56 +0100
commit8384350ee6abb69043ec3c063cabdd02c340696d (patch)
tree6b186bc451aef10530b90c48a24d66abceac87a4
parent1bb284fb1443117dab5850d1e00c68d4287a5145 (diff)
fix the life cycle of my RAII object
Change-Id: Ifcd4ab79192be965b57439062354e27af80136b3
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 06001aa392f4..db4f90ea97fb 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -434,9 +434,13 @@ namespace {
int unxErrorHandler(Display* dpy, XErrorEvent* event)
{
- char errorString[256];
- XGetErrorText(dpy, event->type, errorString, 256);
- SAL_WARN("vcl.opengl", errorString);
+ char err[256];
+ char req[256];
+ char minor[256];
+ XGetErrorText(dpy, event->error_code, err, 256);
+ XGetErrorText(dpy, event->request_code, req, 256);
+ XGetErrorText(dpy, event->minor_code, minor, 256);
+ SAL_WARN("vcl.opengl", "Error: " << err << ", Req: " << req << ", Minor: " << minor);
return 0;
}
@@ -705,7 +709,7 @@ bool OpenGLContext::init(Display* dpy, Pixmap pix, unsigned int width, unsigned
bool OpenGLContext::ImplInit()
{
GLXContext pSharedCtx( NULL );
- TempErrorHandler(m_aGLWin.dpy, unxErrorHandler);
+ TempErrorHandler aErrorHandler(m_aGLWin.dpy, unxErrorHandler);
SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
@@ -798,7 +802,7 @@ bool OpenGLContext::ImplInit()
glXSwapIntervalProc glXSwapInterval = reinterpret_cast<glXSwapIntervalProc>(glXGetProcAddress( reinterpret_cast<const GLubyte*>("glXSwapIntervalSGI") ));
if( glXSwapInterval )
{
- TempErrorHandler(m_aGLWin.dpy, oglErrorHandler);
+ TempErrorHandler aLocalErrorHandler(m_aGLWin.dpy, oglErrorHandler);
errorTriggered = false;
@@ -1337,7 +1341,7 @@ void OpenGLContext::makeCurrent()
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
- TempErrorHandler(m_aGLWin.dpy, unxErrorHandler);
+ TempErrorHandler aErrorHandler(m_aGLWin.dpy, unxErrorHandler);
GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win;
if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx ))