From c5cf34948acafc7ecb22e481fd513c62111bbc0f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 May 2012 23:10:46 +0000 Subject: Destroy window before closing display. --- pugl/pugl_x11.c | 11 +++++------ 1 file 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); } -- cgit v1.2.1