X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=progs%2Fdemos%2Ftunnel2.c;h=0288ea0f8ceaede6de5f4e5aee1d99f825ec1a55;hb=9615daa9324341f6a56932dc46b807f402d18283;hp=f4171a8346d60c5b9414e7c3806389e6d3298dfe;hpb=5340b6dff73a0a23531ce2a5f28fba8303adab6e;p=mesa.git diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c index f4171a8346d..0288ea0f8ce 100644 --- a/progs/demos/tunnel2.c +++ b/progs/demos/tunnel2.c @@ -200,6 +200,13 @@ special(int k, int x, int y) } } +static void +cleanup(void) +{ + glDeleteTextures(1, &t1id); + glDeleteTextures(1, &t2id); +} + static void key(unsigned char k, int x, int y) { @@ -207,6 +214,7 @@ key(unsigned char k, int x, int y) case 27: glutDestroyWindow(channel[0]); glutDestroyWindow(channel[1]); + cleanup(); exit(0); break; @@ -602,6 +610,7 @@ main(int ac, char **av) calcposobs(); glutMainLoop(); + cleanup(); return 0; }