Merge branch 'main' of gitlab.emi.u-bordeaux.fr:pt2/teams/a42/lightup-a42e
This commit is contained in:
commit
749b3b5af3
1 file changed
+5
-8
@@ -77,18 +77,14 @@ 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;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user