vcl/source/opengl/OpenGLHelper.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 884bea629dc61d73ae1f0af6d55ee37df035c8de
Author: Michael Meeks <michael.me...@collabora.com>
Date:   Mon Aug 31 11:18:19 2015 +0100

    tdf#93798 - avoid apitrace provoked infinite loop dumping errors.
    
    Change-Id: I6c42e6a9ead90ed6fad2f289cd686a72cffa0c2d

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 87fec55..68b8d50 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -400,6 +400,7 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t 
nLine)
 {
     OpenGLZone aZone;
 
+    int nErrors = 0;
     for (;;)
     {
         GLenum glErr = glGetError();
@@ -413,6 +414,13 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t 
nLine)
             SAL_WARN("vcl.opengl", "GL Error #" << glErr << "(" << sError << 
") in File " << pFile << " at line: " << nLine);
         else
             SAL_WARN("vcl.opengl", "GL Error #" << glErr << " (no message 
available) in File " << pFile << " at line: " << nLine);
+
+        // 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;
+        }
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to