Skip to content

Commit be57747

Browse files
committed
backend/gl/glx: fix assertion failure when glx context creation fails
Signed-off-by: Yuxuan Shui <[email protected]>
1 parent 9ab7eb8 commit be57747

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/gl/glx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,9 @@ static void glx_release_image(backend_t *base, struct gl_texture *tex) {
179179
void glx_deinit(backend_t *base) {
180180
struct _glx_data *gd = (void *)base;
181181

182-
gl_deinit(&gd->gl);
183-
184182
// Destroy GLX context
185183
if (gd->ctx) {
184+
gl_deinit(&gd->gl);
186185
glXMakeCurrent(base->c->dpy, None, NULL);
187186
glXDestroyContext(base->c->dpy, gd->ctx);
188187
gd->ctx = 0;
@@ -297,7 +296,7 @@ static backend_t *glx_init(session_t *ps, xcb_window_t target) {
297296
}
298297

299298
gd->ctx = glXCreateContextAttribsARB(ps->c.dpy, cfg[i], 0, true, attributes);
300-
free(cfg);
299+
free((void *)cfg);
301300

302301
if (!gd->ctx) {
303302
log_error("Failed to get GLX context.");

0 commit comments

Comments
 (0)