I've confirmed that the following code:
gameCore->window.display();
causes most errors, and this:
gameCore->window.setActive(true);
only causes 1 to 5 at the beginning. Must have to do with the way I'm accessing gameCore. Is there another way I could access it?