progs/demos: call glutDestroyWindow() in gloss.c
authorBrian Paul <brianp@vmware.com>
Wed, 9 Dec 2009 21:53:53 +0000 (14:53 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 9 Dec 2009 21:53:53 +0000 (14:53 -0700)
progs/demos/gloss.c

index 69694b2..56d48b5 100644 (file)
@@ -41,6 +41,7 @@
 /* for convolution */
 #define FILTER_SIZE 7
 
+static GLint Win;
 static GLint WinWidth = 500, WinHeight = 500;
 static GLuint CylinderObj = 0;
 static GLuint TeapotObj = 0;
@@ -215,6 +216,7 @@ static void Key( unsigned char key, int x, int y )
          ToggleAnimate();
          break;
       case 27:
+         glutDestroyWindow(Win);
          exit(0);
          break;
    }
@@ -439,7 +441,7 @@ int main( int argc, char *argv[] )
    glutInit( &argc, argv );
    glutInitWindowSize(WinWidth, WinHeight);
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
-   glutCreateWindow(argv[0] );
+   Win = glutCreateWindow(argv[0] );
    glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );