kripken/emscripten — pull request #1220 by inolen (2013-05-30 07:11:14+00:00)
Title: SDL_SetVideoMode: Free old surface before creating new one

https://github.com/kripken/emscripten/issues/1218

The C API does the same thing:
https://github.com/WinterMute/SDL-1.2/blob/master/src/video/SDL_video.c#L846

I looked into writing a small regression test for this, but there doesn't appear to be a sane way to check if an SDL surface has been free'd in the C API.