Also your init function is (maybe) leaking memory:GameWindow and MainGLWindow don't get deleted and you don't save the pointers anywhere to get deleted later (at least that's the case in the code snippet you posted).