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
commit7e7647f8728abc57ccbbef6f783f06b314100daa (patch)
tree3206bca9c50a6f38405ef395c9f2efb99f09a256
parentcf4aff4a86f2c70781768690154f688222632c61 (diff)
downloadopenttd-7e7647f8728abc57ccbbef6f783f06b314100daa.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()