summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-01 23:21:45 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-01 23:21:45 +0000
commit12e0b7a12a177cee9ab6e1f16d032d05da47a429 (patch)
tree7d5ffe863344db9fb82eef811107e5805ba5fafe /src/map/guild.c
parent983fcb851918b1ab40c182f6719b7e800fe0d643 (diff)
downloadhercules-12e0b7a12a177cee9ab6e1f16d032d05da47a429.tar.gz
hercules-12e0b7a12a177cee9ab6e1f16d032d05da47a429.tar.bz2
hercules-12e0b7a12a177cee9ab6e1f16d032d05da47a429.tar.xz
hercules-12e0b7a12a177cee9ab6e1f16d032d05da47a429.zip
Enabled `DB_OPT_RELEASE_DATA` for several `DBMap`s to simplify data freeing.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15644 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 335d77301..5a5f72ea4 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -1914,12 +1914,6 @@ bool guild_isallied(int guild_id, int guild_id2)
return( i < MAX_GUILDALLIANCE && g->alliance[i].opposition == 0 );
}
-static int guild_infoevent_db_final(DBKey key,void *data,va_list ap)
-{
- aFree(data);
- return 0;
-}
-
static int guild_expcache_db_final(DBKey key,void *data,va_list ap)
{
ers_free(expcache_ers, data);
@@ -1940,9 +1934,9 @@ void do_init_guild(void)
guild_db=idb_alloc(DB_OPT_RELEASE_DATA);
castle_db=idb_alloc(DB_OPT_BASE);
guild_expcache_db=idb_alloc(DB_OPT_BASE);
- guild_infoevent_db=idb_alloc(DB_OPT_BASE);
+ guild_infoevent_db=idb_alloc(DB_OPT_BASE|DB_OPT_RELEASE_DATA);
expcache_ers = ers_new(sizeof(struct guild_expcache));
- guild_castleinfoevent_db=idb_alloc(DB_OPT_BASE);
+ guild_castleinfoevent_db=idb_alloc(DB_OPT_BASE|DB_OPT_RELEASE_DATA);
sv_readdb(db_path, "castle_db.txt", ',', 4, 5, -1, &guild_read_castledb);
@@ -1957,10 +1951,10 @@ void do_init_guild(void)
void do_final_guild(void)
{
- guild_db->destroy(guild_db,NULL);
+ db_destroy(guild_db);
castle_db->destroy(castle_db,guild_castle_db_final);
guild_expcache_db->destroy(guild_expcache_db,guild_expcache_db_final);
- guild_infoevent_db->destroy(guild_infoevent_db,guild_infoevent_db_final);
- guild_castleinfoevent_db->destroy(guild_castleinfoevent_db,guild_infoevent_db_final);
+ db_destroy(guild_infoevent_db);
+ db_destroy(guild_castleinfoevent_db);
ers_destroy(expcache_ers);
}