summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-05-13 21:55:02 +0200
committerglx22 <glx22@users.noreply.github.com>2019-05-15 21:59:57 +0200
commitaac4255d43bf6cdc763cba0c1244a9c2e0fad055 (patch)
tree75efca4e23a24f4ddc29e292d36614b916d2d2b1
parentde73c8f91c56d9bd0e2c4bfb9791995450932e49 (diff)
downloadopenttd-aac4255d43bf6cdc763cba0c1244a9c2e0fad055.tar.xz
Fix #7590: decrement allocated_size in ScriptAllocator::Free()
-rw-r--r--src/script/squirrel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp
index ea63944ea..275a89c74 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -93,6 +93,7 @@ struct ScriptAllocator {
{
if (p == nullptr) return;
free(p);
+ this->allocated_size -= size;
#ifdef SCRIPT_DEBUG_ALLOCATIONS
assert(this->allocations.at(p) == size);