diff options
author | shennetsind <ind@henn.et> | 2014-03-15 17:48:44 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-03-15 17:48:44 -0300 |
commit | c30a02c23b736acdd6a4ba14d3dd458cd74e5422 (patch) | |
tree | 1e10140f53542b8e8502c36cd36c329b03b9290d /src/map/script.c | |
parent | 82e5f6d59d607f35283751c14587b944c702952f (diff) | |
download | hercules-c30a02c23b736acdd6a4ba14d3dd458cd74e5422.tar.gz hercules-c30a02c23b736acdd6a4ba14d3dd458cd74e5422.tar.bz2 hercules-c30a02c23b736acdd6a4ba14d3dd458cd74e5422.tar.xz hercules-c30a02c23b736acdd6a4ba14d3dd458cd74e5422.zip |
Follow up f4b1ff7426b1c4cd5e8cac37f7e3983cc03c706e
Memory leak from bug report 8090 which was created in f4b1ff7426b1c4cd5e8cac37f7e3983cc03c706e when I somehow managed to assume all instances consuming memory would be active.
Special Thanks to LordOdin!
http://hercules.ws/board/tracker/issue-8090-memory-leak/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 63b76e35b..5a33a39ed 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3210,6 +3210,11 @@ void script_free_code(struct script_code* code) { if( code->instances ) script->stop_instances(code); + else { + script->free_vars(code->local.vars); + if( code->local.arrays ) + code->local.arrays->destroy(code->local.arrays,script->array_free_db); + } aFree( code->script_buf ); aFree( code ); } |