Could someone please explain to me exactly what SDL_FreeSurface does? Because whenever I try to use it in anything other than the simplest of programs, it hits a break point.
SDL uses (internally) dynamically allocated memory for storing RGB surfaces (such as images from your hard disk) and those surfaces are needed to be freed once you have used them.
Just like you need to use
delete-operator for each