From d6ad1b79b97974ad3e3bd2a1b2c7474f0dd797b0 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 2 May 2022 21:15:28 +0200 Subject: Fix crash when destroying OpenGL views that haven't been realized --- src/x11_gl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/x11_gl.c') diff --git a/src/x11_gl.c b/src/x11_gl.c index 1ebe829..41007cd 100644 --- a/src/x11_gl.c +++ b/src/x11_gl.c @@ -103,6 +103,9 @@ static PuglStatus puglX11GlEnter(PuglView* view, const PuglExposeEvent* PUGL_UNUSED(expose)) { PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface; + if (!surface || !surface->ctx) { + return PUGL_FAILURE; + } return glXMakeCurrent(view->impl->display, view->impl->win, surface->ctx) ? PUGL_SUCCESS -- cgit v1.2.1