From 5ad587d20814ec1fac9594fea53db3436a96dedd Mon Sep 17 00:00:00 2001 From: spanne Date: Sat, 28 Feb 2009 17:09:15 +0000 Subject: [PATCH] Do not try to destroy a GLX context when there is none, e.g. when glXCreateContextAttribsARB is not there. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@785 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/freeglut_window.c b/freeglut/freeglut/src/freeglut_window.c index 8027e6b..cc73b88 100644 --- a/freeglut/freeglut/src/freeglut_window.c +++ b/freeglut/freeglut/src/freeglut_window.c @@ -1025,7 +1025,8 @@ void fgCloseWindow( SFG_Window* window ) { #if TARGET_HOST_POSIX_X11 - glXDestroyContext( fgDisplay.Display, window->Window.Context ); + if( window->Window.Context ) + glXDestroyContext( fgDisplay.Display, window->Window.Context ); XFree( window->Window.FBConfig ); XDestroyWindow( fgDisplay.Display, window->Window.Handle ); /* XFlush( fgDisplay.Display ); */ /* XXX Shouldn't need this */