Well the issue here is, that using your code, you let the randomness of compiler make the "decision" on the execution of your application aka "undefined behavior". Since the Event is never set, it can contain anything. If you're in luck it will not contain Event.key.code == sf::Keyboard::Escape, if you're not in luck, it will exactly contain that and close your application.
The console output seems really odd. When do you get that?