From cafeecb92583759616b564c9cecf892ede3a76fb Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Thu, 14 Apr 2011 19:39:50 +0000 Subject: [PATCH] fixed a memleak introduced when the alternative effects were changed to activated the way they do in current, the issue was that it was returning null if it wasnt paid, however if the alternative lines contained a TC those are built WAY before we get to this point, there was no delete done if the ability returns as NULL. so the tc remains and becomes a memleak. --- projects/mtg/src/MTGAbility.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 16bbe84ad..49e5591ff 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1033,6 +1033,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return parseMagicLine(s1, id, spell, card); } DebugTrace("INFO parseMagicLine: Alternative Cost was not fulfilled for " << s); + if(tc) + SAFE_DELETE(tc); return NULL; }