X11 only: Destroy the global menu rendering context when deinitializing.

The visual/context handling for menus is still rather obscure, though...


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@668 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
spanne 2005-07-06 16:02:48 +00:00
parent a37b090e46
commit e3f40841b6
2 changed files with 8 additions and 0 deletions

View File

@ -1099,3 +1099,7 @@ addition, some related cleanup has been done.
(285) X11 only: Free XVisualInfo structures when they are not needed (285) X11 only: Free XVisualInfo structures when they are not needed
anymore, fixing a space leak. Not perfect for menus yet... 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...

View File

@ -225,6 +225,10 @@ void fgDeinitialize( void )
/* If there was a menu created, destroy the rendering context */ /* If there was a menu created, destroy the rendering context */
if( fgStructure.MenuContext ) 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 ); free( fgStructure.MenuContext );
fgStructure.MenuContext = NULL; fgStructure.MenuContext = NULL;
} }