- 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
+4
View File
@@ -1292,6 +1292,10 @@ class ALord:public ListMaintainerAbility{
return 1; return 1;
} }
~ALord(){
SAFE_DELETE(regenCost);
}
virtual ostream& toString(ostream& out) const virtual ostream& toString(ostream& out) const
{ {
out << "ALord ::: power : " << power out << "ALord ::: power : " << power
+1
View File
@@ -13,6 +13,7 @@ public:
TargetChooser * tc; TargetChooser * tc;
MTGCardInstance * source; MTGCardInstance * source;
ExtraCost(TargetChooser *_tc = NULL); ExtraCost(TargetChooser *_tc = NULL);
~ExtraCost();
virtual int setPayment(MTGCardInstance * card) = 0; virtual int setPayment(MTGCardInstance * card) = 0;
virtual int isPaymentSet() = 0; virtual int isPaymentSet() = 0;
virtual int doPay() = 0; virtual int doPay() = 0;
+4
View File
@@ -7,6 +7,10 @@ ExtraCost::ExtraCost( TargetChooser *_tc):tc(_tc){
} }
ExtraCost::~ExtraCost(){
SAFE_DELETE(tc);
}
int ExtraCost::setSource(MTGCardInstance * _source){ int ExtraCost::setSource(MTGCardInstance * _source){
source=_source; source=_source;
+4
View File
@@ -383,6 +383,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){ if (tc){
if (all){ if (all){
UntapAll(tc); UntapAll(tc);
delete tc;
}else{ }else{
game->addObserver(NEW AUntaper(id, card, cost, tc)); game->addObserver(NEW AUntaper(id, card, cost, tc));
} }
@@ -470,6 +471,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){ if (tc){
if (all){ if (all){
moveAll(tc,szone); moveAll(tc,szone);
delete(tc);
}else{ }else{
AZoneMover * a = NEW AZoneMover(id,card,tc,szone,cost,doTap); AZoneMover * a = NEW AZoneMover(id,card,tc,szone,cost,doTap);
if (may){ if (may){
@@ -623,6 +625,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
game->addObserver(a); game->addObserver(a);
}else{ }else{
damageAll(tc,damage); damageAll(tc,damage);
delete tc;
} }
}else{ }else{
MTGAbility * a = NEW ADamager(id, card, cost, damage, tc,doTap); 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 (tc){
if (all){ if (all){
TapAll(tc); TapAll(tc);
delete tc;
}else{ }else{
game->addObserver(NEW ATapper(id, card, cost, tc)); game->addObserver(NEW ATapper(id, card, cost, tc));
} }