Do the SDL_Quit() before the IMG_Quit() , because it seems IMG_Quit() has to be last function called: https://wiki.libsdl.org/SDL2_image/IMG_Quit