implementation of history in struct game and fcts

This commit is contained in:
Théophyl Hoguet committed 2021-12-10 14:38:18 +01:00
1 parent 256556e1f8
commit b48d52bb6b
3 files changed
+7 -1

No files matched your search

+4
View File
@@ -36,6 +36,7 @@ game game_new_empty(void) {
g->wrapped = false;
g->height = DEFAULT_SIZE;
g->width = DEFAULT_SIZE;
g->hist = NULL;
return g;
}
@@ -69,6 +70,9 @@ void game_delete(game g) {
free(g->tab_cell);
if (g->tab_cell != NULL)
g->tab_cell = NULL;
history_delete_entire_history(g->hist);
if (g->hist != NULL)
g->hist = NULL;
free(g);
if (g != NULL)
g = NULL;