home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Re-wrote large parts of the server client architecture. No more fifo.
[plomrogue]
/
src
/
client
/
cleanup.c
diff --git
a/src/client/cleanup.c
b/src/client/cleanup.c
index 7df98e7c4bd716ccc441ff2d263f317bf4df4a39..f060250a85a717f068284cc74e8381dfeac5df77 100644
(file)
--- a/
src/client/cleanup.c
+++ b/
src/client/cleanup.c
@@
-1,11
+1,12
@@
/* src/client/cleanup.c */
#include "cleanup.h"
/* src/client/cleanup.c */
#include "cleanup.h"
+#include <ncurses.h> /* for endwin() */
#include <stdint.h> /* uint32_t */
#include <stdlib.h> /* free() */
#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 "command_db.h" /* free_command_db() */
#include "misc.h" /* unload_interface_conf() */
-#include "windows.h" /* free_winmeta_and_endwin() */
#include "world.h" /* world global */
#include "world.h" /* world global */
@@
-17,21
+18,30
@@
static uint32_t cleanup_flags = 0x0000;
extern void cleanup()
{
extern void cleanup()
{
+ char * f_name = "cleanup()";
free(world.map.cells);
free(world.log);
free(world.player_inventory);
free(world.map.cells);
free(world.log);
free(world.player_inventory);
- if (cleanup_flags & CLEANUP_INTERFACE)
/* Must come pre ncurses cleanup, */
- {
/* for by closing all windows it */
- unload_interface_conf();
/* relies on world.wmeta data freed */
- }
/* by free_winmeta_and_endwin(). */
+ if (cleanup_flags & CLEANUP_INTERFACE)
+ {
+ unload_interface_conf();
+ }
if (cleanup_flags & CLEANUP_NCURSES)
{
if (cleanup_flags & CLEANUP_NCURSES)
{
-
free_winmeta_and_
endwin();
+ endwin();
}
if (cleanup_flags & CLEANUP_COMMANDS)
{
free_command_db();
}
}
if (cleanup_flags & CLEANUP_COMMANDS)
{
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);
+ }
}
}