diff options
Diffstat (limited to 'vcl/source/opengl/OpenGLHelper.cxx')
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index f255b3a1141a..958d5237d150 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; + } } } |