From: Sven Panne Date: Wed, 6 Jul 2005 16:02:48 +0000 (+0000) Subject: X11 only: Destroy the global menu rendering context when deinitializing. X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=330e4a477e6d96a82b4aeccc471a86b57a860b84;p=freeglut X11 only: Destroy the global menu rendering context when deinitializing. The visual/context handling for menus is still rather obscure, though... git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@668 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/ChangeLog b/ChangeLog index e4cdea1..8b2a0e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1099,3 +1099,7 @@ addition, some related cleanup has been done. (285) X11 only: Free XVisualInfo structures when they are not needed anymore, fixing a space leak. Not perfect for menus yet... + +(286) X11 only: Destroy the global menu rendering context when +deinitializing. The visual/context handling for menus is still rather +obscure, though... diff --git a/src/freeglut_init.c b/src/freeglut_init.c index a8a59d4..e25b43c 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -225,6 +225,10 @@ void fgDeinitialize( void ) /* If there was a menu created, destroy the rendering context */ if( fgStructure.MenuContext ) { +#if TARGET_HOST_UNIX_X11 + /* Note that the MVisualInfo is not owned by the MenuContext! */ + glXDestroyContext( fgDisplay.Display, fgStructure.MenuContext->MContext ); +#endif free( fgStructure.MenuContext ); fgStructure.MenuContext = NULL; }