diff options
author | shennetsind <ind@henn.et> | 2014-03-16 17:01:12 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-03-16 17:01:12 -0300 |
commit | fbadf1351940a8e6a184a736b1e2e81a575a0a80 (patch) | |
tree | 17664f621ebbde5069578a3f6272f6eb1c179c35 /src | |
parent | 502f2510a29d3b32cd601c775817bd9e98c7fc0d (diff) | |
download | hercules-fbadf1351940a8e6a184a736b1e2e81a575a0a80.tar.gz hercules-fbadf1351940a8e6a184a736b1e2e81a575a0a80.tar.bz2 hercules-fbadf1351940a8e6a184a736b1e2e81a575a0a80.tar.xz hercules-fbadf1351940a8e6a184a736b1e2e81a575a0a80.zip |
Fixed Bug 8093
Special Thanks to Haruna for pinpointing the cause, developing test cases and contributing to the final solution :3
http://hercules.ws/board/tracker/issue-8093-memory-leak-after-stop-server-cant-fix/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 5a33a39ed..6bd215752 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8285,6 +8285,18 @@ BUILDIN(getgroupid) /// end BUILDIN(end) { st->state = END; + + /* are we stopping inside a function? */ + if( st->stack->defsp >= 1 && st->stack->stack_data[st->stack->defsp-1].type == C_RETINFO ) { + int i; + for(i = 0; i < st->stack->sp; i++) { + if( st->stack->stack_data[i].type == C_RETINFO ) {/* grab the first, aka the original */ + struct script_retinfo *ri = st->stack->stack_data[i].u.ri; + st->script = ri->script; + break; + } + } + } return true; } |