Can you give more details on your program and hardware setup ? like video card, drivers, etc
Are you using GLUT, or win32 calls, or whatever else ?
How do you handle closing events ?
Do the program print some messages or show some dialog when it crashes? I think the best way in your case is comment out most of parts of OpenGL codes and try to find which part causes the problem at application exit. It seems like you have problems with memory access and youe data rewrite some memory area and destroy one or more pointers…