diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-02 15:40:25 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-02 15:40:25 +0000 |
commit | 2898a10e8ec1df9afaa27ff1d0cb685fcb964720 (patch) | |
tree | 8cd3de8a740256d8d5afefa55206138ae4139bae /src/map/map.c | |
parent | eb941f3cf5b97d09faa34116e78648b7eaf6b2fb (diff) | |
download | hercules-2898a10e8ec1df9afaa27ff1d0cb685fcb964720.tar.gz hercules-2898a10e8ec1df9afaa27ff1d0cb685fcb964720.tar.bz2 hercules-2898a10e8ec1df9afaa27ff1d0cb685fcb964720.tar.xz hercules-2898a10e8ec1df9afaa27ff1d0cb685fcb964720.zip |
- 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
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 7 |
1 files changed, 7 insertions, 0 deletions
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]) |