From 719a6c0006ed5e982b283c9a616973600db8c7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 12 Jan 2022 14:02:25 +0100 Subject: [PATCH] egl: Don't set an error when there is none Some API will return NULL or the equivalent; sometimes it's an error, and sometimes it's not, and the way to check that is by looking at the return value of eglGetError(). When we check this, don't set the GError if it returned EGL_SUCCESS, as that indicates that the return value is expected behavior, and not an error. Part-of: --- src/backends/meta-egl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c index 0563b55b5..8adc2407e 100644 --- a/src/backends/meta-egl.c +++ b/src/backends/meta-egl.c @@ -159,6 +159,9 @@ set_egl_error (GError **error) return; error_number = eglGetError (); + if (error_number == EGL_SUCCESS) + return; + error_str = get_egl_error_str (error_number); g_set_error_literal (error, META_EGL_ERROR, error_number,