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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
This commit is contained in:
Jonas Ådahl 2022-01-12 14:02:25 +01:00 committed by Marge Bot
parent 48d0d7a210
commit 719a6c0006

View File

@ -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,