diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index ea63944ea9..275a89c74c 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);