diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-01 23:21:45 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-01 23:21:45 +0000 |
commit | 12e0b7a12a177cee9ab6e1f16d032d05da47a429 (patch) | |
tree | 7d5ffe863344db9fb82eef811107e5805ba5fafe /src/map/skill.c | |
parent | 983fcb851918b1ab40c182f6719b7e800fe0d643 (diff) | |
download | hercules-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/skill.c')
-rw-r--r-- | src/map/skill.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 6a87829d2..ffbb91275 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -14723,10 +14723,9 @@ int skill_blockpc_end(int tid, unsigned int tick, int id, intptr_t data) } cursor++; } - if( cursor == 0 ) { + if( cursor == 0 ) idb_remove(skillcd_db,sd->status.char_id); - aFree(cd); - } else + else cd->cursor = cursor; } @@ -15688,7 +15687,7 @@ int do_init_skill (void) group_db = idb_alloc(DB_OPT_BASE); skillunit_db = idb_alloc(DB_OPT_BASE); - skillcd_db = idb_alloc(DB_OPT_BASE); + skillcd_db = idb_alloc(DB_OPT_RELEASE_DATA); skill_unit_ers = ers_new(sizeof(struct skill_unit_group)); skill_timer_ers = ers_new(sizeof(struct skill_timerskill)); @@ -15703,20 +15702,12 @@ int do_init_skill (void) return 0; } -int skillcd_db_final(DBKey key, void *data, va_list args) -{ - struct skillcd *s = (struct skillcd*)data; - if( s != NULL) - aFree(s); - return 0; -} - int do_final_skill(void) { db_destroy(skilldb_name2id); db_destroy(group_db); db_destroy(skillunit_db); - skillcd_db->destroy(skillcd_db, skillcd_db_final); + db_destroy(skillcd_db); ers_destroy(skill_unit_ers); ers_destroy(skill_timer_ers); return 0; |