Hey guys, ok whats going on here is, that my game when it is in the actual game play screen, when it has the map and stuff drawn, it loads everything fine, connects to the MySQL server and draws all my pretty little squares and triangles I am using for testing, but after a few seconds it closes with this error

The thread 'Win32 Thread' (0x1498) has exited with code 1 (0x1).
The program '[4988] TD4.exe: Native' has exited with code 1 (0x1).

Now it only happens when it is in the game play screen, in the menu it will run fine, does anyone have any ideas why or how I can fix this, I am doing Windows progamming and using OpenGL

Thanks in advance guys