Merge branch 'main' of gitlab.emi.u-bordeaux.fr:pt2/teams/a42/lightup-a42e

This commit is contained in:
thibault perrier committed 2022-01-06 02:20:39 +01:00
commit 749b3b5af3
1 file changed
+1 -4
+1 -4
View File
@@ -77,17 +77,13 @@ bool game_equal(cgame g1, cgame g2) {
void game_delete(game g) { void game_delete(game g) {
for (int i = 0; i < g->height; i++) { for (int i = 0; i < g->height; i++) {
free(g->tab_cell[i]); free(g->tab_cell[i]);
if (g->tab_cell[i] != NULL)
g->tab_cell[i] = NULL; g->tab_cell[i] = NULL;
} }
free(g->tab_cell); free(g->tab_cell);
if (g->tab_cell != NULL)
g->tab_cell = NULL; g->tab_cell = NULL;
history_delete_entire_history(g->hist); history_delete_entire_history(g->hist);
if (g->hist != NULL)
g->hist = NULL; g->hist = NULL;
free(g); free(g);
if (g != NULL)
g = NULL; g = NULL;
return; return;
} }
@@ -274,4 +270,5 @@ void game_restart(game g) {
} }
game_update_flags(g); game_update_flags(g);
history_delete_entire_history(g->hist); history_delete_entire_history(g->hist);
g->hist = NULL;
} }