calling SDL_Quit() stopped the segfault

This commit is contained in:
Josh Holtrop 2013-02-02 21:29:31 -05:00
parent 34223e9403
commit 3e09fbb66f

View File

@ -16,13 +16,15 @@ int main(char[][] args)
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_Surface *screen; SDL_Surface *screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32, SDL_OPENGL);
if ((screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32, SDL_OPENGL)) == null) if (screen == null)
{ {
printf("Failed to set video mode!\n"); printf("Failed to set video mode!\n");
SDL_Quit(); SDL_Quit();
return 2; return 2;
} }
SDL_Quit();
return 0; return 0;
} }