diff options
author | David Robillard <d@drobilla.net> | 2012-05-10 23:10:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-10 23:10:46 +0000 |
commit | c5cf34948acafc7ecb22e481fd513c62111bbc0f (patch) | |
tree | efe34dbc7cd40293570ae4efd397f32417d94427 | |
parent | f027f3810baaa93bd4b8273b774421053e8e1cac (diff) | |
download | pugl-c5cf34948acafc7ecb22e481fd513c62111bbc0f.tar.gz pugl-c5cf34948acafc7ecb22e481fd513c62111bbc0f.tar.bz2 pugl-c5cf34948acafc7ecb22e481fd513c62111bbc0f.zip |
Destroy window before closing display.
-rw-r--r-- | pugl/pugl_x11.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index d80b71b..dde2b23 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -155,14 +155,13 @@ puglCreate(PuglNativeWindow parent, void puglDestroy(PuglView* view) { - if (view->impl->ctx) { - if (!glXMakeCurrent(view->impl->display, None, NULL)) { - printf("Could not release drawing context.\n"); - } - glXDestroyContext(view->impl->display, view->impl->ctx); - view->impl->ctx = NULL; + if (!view) { + return; } + glXMakeCurrent(view->impl->display, None, NULL); + glXDestroyContext(view->impl->display, view->impl->ctx); + XDestroyWindow(view->impl->display, view->impl->win); XCloseDisplay(view->impl->display); free(view); } |