diff options
author | Brian Paul <brianp@vmware.com> | 2011-07-21 09:10:48 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2011-07-21 10:10:52 -0600 |
commit | e980752741cb2347b4a287c829bb27a6a2b4f0d3 (patch) | |
tree | e8631603778d3ff29aee75beae923dcc2ff22b8c | |
parent | a1af8f914f024dfe7cf548d4a3a3ee21b31c1f5a (diff) |
polys: destroy window before exiting
-rw-r--r-- | src/redbook/polys.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 <stdlib.h> #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); |