From 2898a10e8ec1df9afaa27ff1d0cb685fcb964720 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 2 Aug 2006 15:40:25 +0000 Subject: - Fixed script code data not being free'd if a player quits in the middle of a script. - Modified run_script so that when there are leaks, it will report the place where run_script was called from as source rather than the inner code of run_script (for debugging purposes) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8057 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 2e198bb0d..34a18f033 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1695,6 +1695,13 @@ int map_quit(struct map_session_data *sd) { sd->regstr = NULL; sd->regstr_num = 0; } + if (sd->st) { + if (sd->st->stack) + script_free_stack (sd->st->stack); + aFree(sd->st); + sd->st = NULL; + sd->npc_id = 0; + } if(sd->fd) { //Player will be free'd on save-ack. [Skotlex] if (session[sd->fd]) -- cgit v1.2.3-60-g2f50