[SDL] the window surface should not be freed

According to SDL's docs, the window surface is freed automatically by
other functions (SDL_Quit in SDL1.2, and SDL_DestroyWindow in SDL2).

I think this might have actually been the cause of those segmentation
errors upon closing that I noticed back when I opened #114.
This commit is contained in:
Clownacy 2018-07-02 21:04:35 +01:00
parent 3edcab0b46
commit 5eafe5b0cc
2 changed files with 3 additions and 8 deletions

View File

@ -244,10 +244,7 @@ static void sdl_video_update()
static void sdl_video_close()
{
if (sdl_video.surf_bitmap)
SDL_FreeSurface(sdl_video.surf_bitmap);
if (sdl_video.surf_screen)
SDL_FreeSurface(sdl_video.surf_screen);
SDL_FreeSurface(sdl_video.surf_bitmap);
}
/* Timer Sync */

View File

@ -250,10 +250,8 @@ static void sdl_video_update()
static void sdl_video_close()
{
if (sdl_video.surf_bitmap)
SDL_FreeSurface(sdl_video.surf_bitmap);
if (sdl_video.surf_screen)
SDL_FreeSurface(sdl_video.surf_screen);
SDL_FreeSurface(sdl_video.surf_bitmap);
SDL_DestroyWindow(sdl_video.window);
}
/* Timer Sync */