X11 only: Destroy the global menu rendering context when deinitializing.
authorSven Panne <sven.panne@aedion.de>
Wed, 6 Jul 2005 16:02:48 +0000 (16:02 +0000)
committerSven Panne <sven.panne@aedion.de>
Wed, 6 Jul 2005 16:02:48 +0000 (16:02 +0000)
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

ChangeLog
src/freeglut_init.c

index e4cdea1..8b2a0e2 100644 (file)
--- 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...
index a8a59d4..e25b43c 100644 (file)
@@ -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;
     }