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

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Sep 8 09:05:47 PDT 2015


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

New commits:
commit 2fd94938a9e45ef143aac51a589654387796e388
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>

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index db39c73..5ca7704 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -465,18 +465,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