and releases (also from main thread) the SDL's resources on application closure by calling: SDL_Quit() For performance reason (the main thread makes already a lot of work) the SDL_PumpEvents() was ...