- revert r3645
- fix memory leak in GenericInstantAbility
This commit is contained in:
@@ -825,20 +825,6 @@ public:
|
||||
return a;
|
||||
}
|
||||
};
|
||||
|
||||
//make instant ability out of anything
|
||||
class AGenericInstantWrapper: public InstantAbility
|
||||
{
|
||||
public:
|
||||
MTGAbility * ability;
|
||||
|
||||
AGenericInstantWrapper(int id, MTGCardInstance * source, Damageable * target,MTGAbility * wrapThis);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AGenericInstantWrapper * clone() const;
|
||||
~AGenericInstantWrapper();
|
||||
};
|
||||
|
||||
//counters
|
||||
class AACounter: public ActivatedAbility
|
||||
{
|
||||
@@ -1773,16 +1759,25 @@ public:
|
||||
|
||||
int destroy()
|
||||
{
|
||||
ability->forceDestroy = 1;
|
||||
if (game->removeObserver(ability))
|
||||
ability = NULL;
|
||||
else
|
||||
SAFE_DELETE(ability);
|
||||
return InstantAbility::destroy();
|
||||
}
|
||||
|
||||
GenericInstantAbility * clone() const
|
||||
{
|
||||
GenericInstantAbility * a = NEW GenericInstantAbility(*this);
|
||||
a->ability = ability->clone();
|
||||
a->isClone = 1;
|
||||
return a;
|
||||
}
|
||||
|
||||
~GenericInstantAbility()
|
||||
{
|
||||
SAFE_DELETE(ability);
|
||||
}
|
||||
};
|
||||
|
||||
//Circle of Protections
|
||||
|
||||
Reference in New Issue
Block a user