[Fix] Freeing of video modes.
This commit is contained in:
parent
a392c2c67b
commit
2be93f741c
@ -515,10 +515,6 @@ int gl_init(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; modes[i]; ++i)
|
||||
free(modes[i]);
|
||||
free(modes);
|
||||
|
||||
// Make sure fullscreen mode is supported.
|
||||
if(flags & SDL_FULLSCREEN && !supported) {
|
||||
WARN("Fullscreen mode %dx%d is not supported by your current setup, switching to another mode",
|
||||
@ -526,6 +522,10 @@ int gl_init(void) {
|
||||
gl_screen.w = modes[0]->w;
|
||||
gl_screen.h = modes[0]->h;
|
||||
}
|
||||
// Free the video modes.
|
||||
for(i = 0; modes[i]; ++i)
|
||||
free(modes[i]);
|
||||
free(modes);
|
||||
}
|
||||
|
||||
// Test the setup.
|
||||
|
Loading…
Reference in New Issue
Block a user