From 53dd4862401e19138fe2b683488a2a447a357a3a Mon Sep 17 00:00:00 2001 From: korenkonder Date: Mon, 19 May 2025 18:53:39 +0300 Subject: [PATCH] Fixed infinite loop at closure --- src/DivaGL/shared.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/DivaGL/shared.cpp b/src/DivaGL/shared.cpp index a435717..68fd6eb 100644 --- a/src/DivaGL/shared.cpp +++ b/src/DivaGL/shared.cpp @@ -16,9 +16,16 @@ void fbo_blit(p_gl_rend_state& p_gl_rend_st, GLuint src_fbo, GLuint dst_fbo, } void gl_get_error_all_print() { + const int32_t max_count = 0x100; + int32_t count = 0; GLenum error; - while (error = glGetErrorDLL()) + while (error = glGetErrorDLL() && count < max_count) { printf_debug("GL Error: 0x%04X\n", error); + count++; + } + + if (count == max_count) + printf_debug("GL returned more than %d consecutive errors!\n", max_count); } GLenum gl_get_error_print() {