fixed a ton of memleaks, narrowed down the memleaks to just the computeNewCost function.

still working on a fix for this.
This commit is contained in:
zethfoxster
2016-07-04 15:13:35 -04:00
parent 2b8f1b350c
commit c018e3dcc2
5 changed files with 95 additions and 81 deletions

View File

@@ -1319,6 +1319,7 @@ int AACopier::resolve()
MTGCard* clone = MTGCollection()->getCardById(_target->copiedID);
MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game);
source->copy(myClone);
SAFE_DELETE(myClone);
source->isACopier = true;
source->copiedID = _target->getMTGId();
source->modifiedbAbi = _target->modifiedbAbi;
@@ -6133,6 +6134,7 @@ int AProduceMana::produce()
{
AManaProducer *amp = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(ManaDescription,NULL,source), NULL, 0,"",false);
amp->resolve();
SAFE_DELETE(amp);//once you call resolve() on a ability, you can safely delete it.
}
return 1;
}