home · contact · privacy
Re-wrote large parts of the server client architecture. No more fifo.
[plomrogue] / src / client / cleanup.c
index bcf52ac405e0a31ab41c5df4f85ea1e38d432d45..f060250a85a717f068284cc74e8381dfeac5df77 100644 (file)
@@ -4,6 +4,7 @@
 #include <ncurses.h> /* for endwin() */
 #include <stdint.h> /* uint32_t */
 #include <stdlib.h> /* free() */
+#include "../common/readwrite.h" /* try_fclose() */
 #include "command_db.h" /* free_command_db() */
 #include "misc.h" /* unload_interface_conf() */
 #include "world.h" /* world global */
@@ -17,6 +18,7 @@ static uint32_t cleanup_flags = 0x0000;
 
 extern void cleanup()
 {
+    char * f_name = "cleanup()";
     free(world.map.cells);
     free(world.log);
     free(world.player_inventory);
@@ -32,6 +34,14 @@ extern void cleanup()
     {
         free_command_db();
     }
+    if (cleanup_flags & CLEANUP_SERVER_IN)
+    {
+        try_fclose(world.file_server_in, f_name);
+    }
+    if (cleanup_flags & CLEANUP_SERVER_OUT)
+    {
+        try_fclose(world.file_server_out, f_name);
+    }
 }