Erwan
- Lord+Regenerate (zombie master) memory leak fix - "... All" memory leak fix - Sacrifice target memory leak fix
This commit is contained in:
@@ -1292,6 +1292,10 @@ class ALord:public ListMaintainerAbility{
|
||||
return 1;
|
||||
}
|
||||
|
||||
~ALord(){
|
||||
SAFE_DELETE(regenCost);
|
||||
}
|
||||
|
||||
virtual ostream& toString(ostream& out) const
|
||||
{
|
||||
out << "ALord ::: power : " << power
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -7,6 +7,10 @@ ExtraCost::ExtraCost( TargetChooser *_tc):tc(_tc){
|
||||
|
||||
}
|
||||
|
||||
ExtraCost::~ExtraCost(){
|
||||
SAFE_DELETE(tc);
|
||||
}
|
||||
|
||||
|
||||
int ExtraCost::setSource(MTGCardInstance * _source){
|
||||
source=_source;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user