summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 5a5f72ea4..21a606394 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -1914,6 +1914,18 @@ bool guild_isallied(int guild_id, int guild_id2)
return( i < MAX_GUILDALLIANCE && g->alliance[i].opposition == 0 );
}
+static int eventlist_db_final(DBKey key,void *data,va_list ap)
+{
+ struct eventlist *next = NULL;
+ struct eventlist *current = data;
+ while (current != NULL) {
+ next = current->next;
+ aFree(current);
+ current = next;
+ }
+ return 0;
+}
+
static int guild_expcache_db_final(DBKey key,void *data,va_list ap)
{
ers_free(expcache_ers, data);
@@ -1934,9 +1946,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|DB_OPT_RELEASE_DATA);
+ guild_infoevent_db=idb_alloc(DB_OPT_BASE);
expcache_ers = ers_new(sizeof(struct guild_expcache));
- guild_castleinfoevent_db=idb_alloc(DB_OPT_BASE|DB_OPT_RELEASE_DATA);
+ guild_castleinfoevent_db=idb_alloc(DB_OPT_BASE);
sv_readdb(db_path, "castle_db.txt", ',', 4, 5, -1, &guild_read_castledb);
@@ -1954,7 +1966,7 @@ void do_final_guild(void)
db_destroy(guild_db);
castle_db->destroy(castle_db,guild_castle_db_final);
guild_expcache_db->destroy(guild_expcache_db,guild_expcache_db_final);
- db_destroy(guild_infoevent_db);
- db_destroy(guild_castleinfoevent_db);
+ guild_infoevent_db->destroy(guild_infoevent_db,eventlist_db_final);
+ guild_castleinfoevent_db->destroy(guild_castleinfoevent_db,eventlist_db_final);
ers_destroy(expcache_ers);
}