diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-23 15:26:52 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-23 15:26:52 +0000 |
commit | 33b8fd47955eeab26cede233b14d683b8e0491b8 (patch) | |
tree | 041f7df2acc8b46bdb56512f06b0f9706fe6ec29 /src/char_sql/inter.c | |
parent | 7d3fedfa5c264169c544fe3ec977229c50e4baa2 (diff) | |
download | hercules-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_sql/inter.c')
-rw-r--r-- | src/char_sql/inter.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c index a8e0d4f44..13ce0acbe 100644 --- a/src/char_sql/inter.c +++ b/src/char_sql/inter.c @@ -290,12 +290,32 @@ int inter_init(const char *file) inter_pet_sql_init(); inter_accreg_sql_init(); + atexit(inter_final); + //printf ("interserver timer initializing : %d sec...\n",autosave_interval); //i=add_timer_interval(gettick()+autosave_interval,inter_save_timer,0,0,autosave_interval); return 0; } +// finalize +int wis_db_final (void *k, void *data, va_list ap) { + struct WisData *p = data; + if (p) aFree(p); + return 0; +} +void inter_final() { + numdb_final(wis_db, wis_db_final); + + inter_guild_sql_final(); + inter_storage_sql_final(); + inter_party_sql_final(); + inter_pet_sql_final(); + + if (accreg_pt) aFree(accreg_pt); + return; +} + int inter_mapif_init(int fd) { inter_guild_mapif_init(fd); |