Explorar o código

Suppr memoire objet quand fin game

Arthur Brandao %!s(int64=6) %!d(string=hai) anos
pai
achega
a5241c1046
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Serveur/game.c

+ 2 - 0
Serveur/game.c

@@ -325,6 +325,8 @@ void stop_game(Game* g) {
         pthread_mutex_unlock(&playerMutex[(g->index * MAXPLAYER) + i]);
     }
     //Libere la memoire
+    object_clean(g->object);
+    free(g->object);
     for (int i = 0; i < g->width; i++) {
         free(g->map[i]);
     }