From 7e7647f8728abc57ccbbef6f783f06b314100daa Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 23 Jul 2008 18:41:15 +0000 Subject: (svn r13807) -Fix: memory leak when loading groups. --- src/group_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(GetEnginePoolSize()); + + if (this->IsValid()) this->num_engines = CallocT(GetEnginePoolSize()); } Group::~Group() -- cgit v1.2.3-70-g09d2