From e980752741cb2347b4a287c829bb27a6a2b4f0d3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 21 Jul 2011 09:10:48 -0600 Subject: polys: destroy window before exiting --- src/redbook/polys.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/redbook/polys.c b/src/redbook/polys.c index 4889c54f..3d2ce062 100644 --- a/src/redbook/polys.c +++ b/src/redbook/polys.c @@ -44,6 +44,8 @@ #include #include "glut_wrap.h" +static int win; + static void display(void) { GLubyte fly[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -111,6 +113,7 @@ key(unsigned char k, int x, int y) { switch (k) { case 27: /* Escape */ + glutDestroyWindow(win); exit(0); break; default: @@ -128,7 +131,7 @@ int main(int argc, char** argv) glutInit(&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (350, 150); - glutCreateWindow (argv[0]); + win = glutCreateWindow (argv[0]); myinit (); glutDisplayFunc(display); glutReshapeFunc(reshape); -- cgit v1.2.3