aboutsummaryrefslogtreecommitdiffstats
path: root/src/win_gl.c
diff options
context:
space:
mode:
authorJean Pierre Cimalando <jp-dev@inbox.ru>2022-05-02 21:15:28 +0200
committerDavid Robillard <d@drobilla.net>2022-05-03 16:32:50 -0400
commitd6ad1b79b97974ad3e3bd2a1b2c7474f0dd797b0 (patch)
treee6d80b6a12accd39ecc0f33b57e172f3cc21fef4 /src/win_gl.c
parent7a51a9f66332f758c0b590598f0a43ad14686c5a (diff)
downloadpugl-d6ad1b79b97974ad3e3bd2a1b2c7474f0dd797b0.tar.gz
pugl-d6ad1b79b97974ad3e3bd2a1b2c7474f0dd797b0.tar.bz2
pugl-d6ad1b79b97974ad3e3bd2a1b2c7474f0dd797b0.zip
Fix crash when destroying OpenGL views that haven't been realized
Diffstat (limited to 'src/win_gl.c')
-rw-r--r--src/win_gl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/win_gl.c b/src/win_gl.c
index 0a035a1..a755020 100644
--- a/src/win_gl.c
+++ b/src/win_gl.c
@@ -258,6 +258,9 @@ static PuglStatus
puglWinGlEnter(PuglView* view, const PuglExposeEvent* expose)
{
PuglWinGlSurface* surface = (PuglWinGlSurface*)view->impl->surface;
+ if (!surface || !surface->hglrc) {
+ return PUGL_FAILURE;
+ }
wglMakeCurrent(view->impl->hdc, surface->hglrc);