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

Michael Meeks michael.meeks at collabora.com
Mon Aug 31 03:55:18 PDT 2015


 vcl/source/opengl/OpenGLHelper.cxx |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 11fc36a480e4b775fc1b3fbe70b816a860379f9a
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Aug 31 11:25:18 2015 +0100

    tdf#93798 - avoid apitrace provoked infinite loop dumping errors.
    
    Change-Id: I6c42e6a9ead90ed6fad2f289cd686a72cffa0c2d
    Reviewed-on: https://gerrit.libreoffice.org/18165
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index f255b3a..958d523 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -400,9 +400,14 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
 {
     OpenGLZone aZone;
 
-    GLenum glErr = glGetError();
-    if (glErr != GL_NO_ERROR)
+    int nErrors = 0;
+    for (;;)
     {
+        GLenum glErr = glGetError();
+        if (glErr == GL_NO_ERROR)
+        {
+            break;
+        }
         const char* sError = OpenGLHelper::GLErrorString(glErr);
 
         if (sError)
@@ -410,7 +415,12 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
         else
             SAL_WARN("vcl.opengl", "GL Error #" << glErr << " (no message available) in File " << pFile << " at line: " << nLine);
 
-        glErr = glGetError();
+        // tdf#93798 - apitrace appears to sometimes cause issues with an infinite loop here.
+        if (++nErrors >= 8)
+        {
+            SAL_WARN("vcl.opengl", "Breaking potentially recursive glGetError loop");
+            break;
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list