- Lord+Regenerate (zombie master) memory leak fix
- "... All" memory leak fix
- Sacrifice target memory leak fix
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-06-26 11:38:53 +00:00
parent 708af7b675
commit 910401a2e5
4 changed files with 13 additions and 0 deletions

View File

@@ -1292,6 +1292,10 @@ class ALord:public ListMaintainerAbility{
return 1;
}
~ALord(){
SAFE_DELETE(regenCost);
}
virtual ostream& toString(ostream& out) const
{
out << "ALord ::: power : " << power

View File

@@ -13,6 +13,7 @@ public:
TargetChooser * tc;
MTGCardInstance * source;
ExtraCost(TargetChooser *_tc = NULL);
~ExtraCost();
virtual int setPayment(MTGCardInstance * card) = 0;
virtual int isPaymentSet() = 0;
virtual int doPay() = 0;

View File

@@ -7,6 +7,10 @@ ExtraCost::ExtraCost( TargetChooser *_tc):tc(_tc){
}
ExtraCost::~ExtraCost(){
SAFE_DELETE(tc);
}
int ExtraCost::setSource(MTGCardInstance * _source){
source=_source;

View File

@@ -383,6 +383,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){
if (all){
UntapAll(tc);
delete tc;
}else{
game->addObserver(NEW AUntaper(id, card, cost, tc));
}
@@ -470,6 +471,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){
if (all){
moveAll(tc,szone);
delete(tc);
}else{
AZoneMover * a = NEW AZoneMover(id,card,tc,szone,cost,doTap);
if (may){
@@ -623,6 +625,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
game->addObserver(a);
}else{
damageAll(tc,damage);
delete tc;
}
}else{
MTGAbility * a = NEW ADamager(id, card, cost, damage, tc,doTap);
@@ -1007,6 +1010,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){
if (all){
TapAll(tc);
delete tc;
}else{
game->addObserver(NEW ATapper(id, card, cost, tc));
}