summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);