[Fix] Seg fault on quit before entering game.
This commit is contained in:
parent
066065ceff
commit
bce1019847
@ -10,5 +10,5 @@ extern int menu_open;
|
|||||||
void menu_main(void);
|
void menu_main(void);
|
||||||
void menu_small(void);
|
void menu_small(void);
|
||||||
void menu_info(void);
|
void menu_info(void);
|
||||||
void menu_deah(void);
|
void menu_death(void);
|
||||||
|
|
||||||
|
12
src/player.c
12
src/player.c
@ -89,7 +89,11 @@ typedef struct GUI_ {
|
|||||||
Vec2 target;
|
Vec2 target;
|
||||||
} GUI;
|
} GUI;
|
||||||
|
|
||||||
GUI gui; // Le Gui!
|
GUI gui = {
|
||||||
|
.gfx_frame = NULL,
|
||||||
|
.gfx_targetPilot = NULL,
|
||||||
|
.gfx_targetPlanet = NULL
|
||||||
|
};
|
||||||
|
|
||||||
double gui_xoff = 0.;
|
double gui_xoff = 0.;
|
||||||
double gui_yoff = 0.;
|
double gui_yoff = 0.;
|
||||||
@ -912,9 +916,9 @@ static int gui_parse(const xmlNodePtr parent, const char* name) {
|
|||||||
|
|
||||||
// Free the GUI.
|
// Free the GUI.
|
||||||
void gui_free(void) {
|
void gui_free(void) {
|
||||||
gl_freeTexture(gui.gfx_frame);
|
if(gui.gfx_frame) gl_freeTexture(gui.gfx_frame);
|
||||||
gl_freeTexture(gui.gfx_targetPilot);
|
if(gui.gfx_targetPilot) gl_freeTexture(gui.gfx_targetPilot);
|
||||||
gl_freeTexture(gui.gfx_targetPlanet);
|
if(gui.gfx_targetPlanet) gl_freeTexture(gui.gfx_targetPlanet);
|
||||||
|
|
||||||
free(msg_stack);
|
free(msg_stack);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user