Merge pull request #53 from alekskosiacka/master

don't create chequered bg if its not used
This commit is contained in:
Harry Jeffery 2015-12-10 19:22:54 +00:00
commit 6f369cc075

View file

@ -247,7 +247,10 @@ int main(int argc, char** argv)
g_options.nearest_neighbour ? "0" : "1");
/* construct a chequered background texture */
SDL_Texture *chequered_tex = create_chequered(renderer);
SDL_Texture *chequered_tex = NULL;
if(!g_options.solid_bg) {
chequered_tex = create_chequered(renderer);
}
/* set up the required fonts and surfaces for displaying the overlay */
TTF_Init();
@ -561,7 +564,9 @@ int main(int argc, char** argv)
TTF_CloseFont(font);
}
TTF_Quit();
SDL_DestroyTexture(chequered_tex);
if(chequered_tex) {
SDL_DestroyTexture(chequered_tex);
}
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();