summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-23 18:41:15 +0000
committerrubidium <rubidium@openttd.org>2008-07-23 18:41:15 +0000
commit1560fe3298ead7255f27ea899615ceb1612464bb (patch)
tree3206bca9c50a6f38405ef395c9f2efb99f09a256
parentc0e11a797c3ad92dabf3348d7246cc069aff76e9 (diff)
downloadopenttd-1560fe3298ead7255f27ea899615ceb1612464bb.tar.xz
(svn r13807) -Fix: memory leak when loading groups.
-rw-r--r--src/group_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index 43ccbe29f..331feda34 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -51,7 +51,8 @@ DEFINE_OLD_POOL_GENERIC(Group, Group)
Group::Group(PlayerID owner)
{
this->owner = owner;
- this->num_engines = CallocT<uint16>(GetEnginePoolSize());
+
+ if (this->IsValid()) this->num_engines = CallocT<uint16>(GetEnginePoolSize());
}
Group::~Group()