gdk: Fix a maybe-uninitialized warning

If there somehow end up being no `supported_versions`, `ctx` would end
up being dereferenced before being initialised. While I think that’s
unlikely, the compiler doesn’t know that, so let’s just initialise the
variable unconditionally.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-04-12 12:02:10 +01:00
parent d1bb1d091c
commit 680dba6524
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -490,7 +490,7 @@ gdk_x11_context_create_glx_context (GdkGLContext *context,
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkX11GLContextGLX *share_glx = NULL;
GdkSurface *surface = gdk_gl_context_get_surface (context);
GLXContext ctx;
GLXContext ctx = NULL;
int context_attribs[N_GLX_ATTRS], i = 0, flags = 0;
gsize major_idx, minor_idx;
GdkGLVersion version;