[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Sep 11 02:09:42 PDT 2015


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

New commits:
commit be0ab88991878b696ab65b536256684652a01dcd
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
    (cherry picked from commit c94d60d6c164e4552b491d348ab0f5c198b6e856)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/18444
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 5893cf6..ce09793 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -491,18 +491,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