[Libreoffice-commits] core.git: vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Sep 7 13:34:21 PDT 2015


 vcl/source/opengl/OpenGLContext.cxx |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit c94d60d6c164e4552b491d348ab0f5c198b6e856
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Sep 7 22:33:22 2015 +0200

    don't use a null display
    
    Change-Id: Iab0a53abd723f0309f40742636315079a4b2c532

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index a80d24b..df8c6a6 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -492,18 +492,24 @@ public:
     TempErrorHandler(Display* dpy, errorHandler newErrorHandler):
         mdpy(dpy)
     {
-        XLockDisplay(dpy);
-        XSync(dpy, false);
-        oldErrorHandler = XSetErrorHandler(newErrorHandler);
+        if (mdpy)
+        {
+            XLockDisplay(dpy);
+            XSync(dpy, false);
+            oldErrorHandler = XSetErrorHandler(newErrorHandler);
+        }
     }
 
     ~TempErrorHandler()
     {
-        // sync so that we possibly get an XError
-        glXWaitGL();
-        XSync(mdpy, false);
-        XSetErrorHandler(oldErrorHandler);
-        XUnlockDisplay(mdpy);
+        if (mdpy)
+        {
+            // sync so that we possibly get an XError
+            glXWaitGL();
+            XSync(mdpy, false);
+            XSetErrorHandler(oldErrorHandler);
+            XUnlockDisplay(mdpy);
+        }
     }
 };
 


More information about the Libreoffice-commits mailing list