summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-09 14:11:02 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-09 14:11:02 +0000
commit49000e689a2516db20060d88871762f5a3bcac39 (patch)
treeef5ec52daf2c0a2d6bb6c83e5ca393593cbbeed6
parent8e131391349af474197f909bcad4ac3520fa1045 (diff)
downloadhercules-49000e689a2516db20060d88871762f5a3bcac39.tar.gz
hercules-49000e689a2516db20060d88871762f5a3bcac39.tar.bz2
hercules-49000e689a2516db20060d88871762f5a3bcac39.tar.xz
hercules-49000e689a2516db20060d88871762f5a3bcac39.zip
- Fixed a npc-timer memory leak on npc_unload ("[Warning]: ers_obj_destroy: X entries missing, continuing destruction. Manager for entries of size 16.")
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8686 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--src/map/npc.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index d37b4576b..08d442879 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2006/09/09
+ * Fixed a npc-timer memory leak on npc_unload ("[Warning]: ers_obj_destroy:
+ X entries missing, continuing destruction. Manager for entries of size
+ 16.") [Skotlex]
2006/09/08
* Unified the rest and ganster paradise code into a single function.
[Skotlex]
diff --git a/src/map/npc.c b/src/map/npc.c
index 6971313c8..9c3b4f096 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1431,8 +1431,13 @@ int npc_unload (struct npc_data *nd)
}
if (nd->bl.subtype == SCRIPT) {
ev_db->foreach(ev_db,npc_unload_ev,nd->exname); //Clean up all events related.
- if (nd->u.scr.timerid != -1)
+ if (nd->u.scr.timerid != -1) {
+ struct TimerData *td = NULL;
+ td = get_timer(nd->u.scr.timerid);
+ if (td && td->data)
+ ers_free(timer_event_ers, (struct event_timer_data*)td->data);
delete_timer(nd->u.scr.timerid, npc_timerevent);
+ }
npc_cleareventtimer (nd);
if (nd->u.scr.timer_event)
aFree(nd->u.scr.timer_event);