summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-23 15:26:52 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-23 15:26:52 +0000
commit33b8fd47955eeab26cede233b14d683b8e0491b8 (patch)
tree041f7df2acc8b46bdb56512f06b0f9706fe6ec29 /src/char/char.c
parent7d3fedfa5c264169c544fe3ec977229c50e4baa2 (diff)
downloadhercules-33b8fd47955eeab26cede233b14d683b8e0491b8.tar.gz
hercules-33b8fd47955eeab26cede233b14d683b8e0491b8.tar.bz2
hercules-33b8fd47955eeab26cede233b14d683b8e0491b8.tar.xz
hercules-33b8fd47955eeab26cede233b14d683b8e0491b8.zip
* Fixed alot of memory leaks
* Added stray memory cleaning routine to db.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1275 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 1a2b61389..78f4bd3ae 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -22,6 +22,7 @@
#include "socket.h"
#include "timer.h"
#include "mmo.h"
+#include "db.h"
#include "version.h"
#include "lock.h"
#include "char.h"
@@ -630,11 +631,6 @@ int mmo_char_init(void) {
printf("out of memory: mmo_char_init (calloc of char_dat).\n");
exit(1);
}
- online_chars = (struct online_chars*)aCalloc(sizeof(struct online_chars) * 256, 1);
- if (!online_chars) {
- printf("out of memory: mmo_char_init (calloc of online_chars).\n");
- exit(1);
- }
for(i = 0; i < char_max; i++)
{
online_chars[i].char_id = -1;
@@ -3456,8 +3452,9 @@ void do_final(void) {
delete_session(login_fd);
delete_session(char_fd);
- for(i = 0; i < fd_max; i++)
- if(session[i] != NULL) aFree(session[i]);
+ inter_final();
+ exit_dbn();
+ timer_final();
char_log("----End of char-server (normal end with closing of all files)." RETCODE);
}
@@ -3512,7 +3509,6 @@ int do_init(int argc, char **argv) {
online_chars[i].server = -1;
}
-
mmo_char_init();
update_online = time(NULL);