diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-23 13:45:12 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-23 13:45:12 +0000 |
commit | 32eab67bf4512dc0a75751e4654866ee52ac4b43 (patch) | |
tree | a819d55ecb20d6a000bcdd729edbde9a6780c5c3 /src/map | |
parent | e8f32370d3ce62dd46af7a21ecfb49f83a404aea (diff) | |
download | hercules-32eab67bf4512dc0a75751e4654866ee52ac4b43.tar.gz hercules-32eab67bf4512dc0a75751e4654866ee52ac4b43.tar.bz2 hercules-32eab67bf4512dc0a75751e4654866ee52ac4b43.tar.xz hercules-32eab67bf4512dc0a75751e4654866ee52ac4b43.zip |
Fixed memory leaks related to skill cooldown saving (bugreport:5261).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15509 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/skill.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index e2cd4269e..3458e2dca 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -59,8 +59,11 @@ DBMap* skilldb_name2id = NULL; /** * Skill Cool Down Delay Saving + * Struct skill_cd is not a member of struct map_session_data + * to keep cooldowns in memory between player log-ins. + * All cooldowns are reset when server is restarted. **/ -DBMap* skillcd_db = NULL; +DBMap* skillcd_db = NULL; // char_id -> struct skill_cd struct skill_cd { int duration[MAX_SKILL_TREE];//milliseconds short skidx[MAX_SKILL_TREE];//the skill index entries belong to @@ -14890,12 +14893,20 @@ 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); - db_destroy(skillcd_db); + skillcd_db->destroy(skillcd_db, skillcd_db_final); ers_destroy(skill_unit_ers); ers_destroy(skill_timer_ers); return 0; |