-some memory leaks fixes
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-08-29 14:16:58 +00:00
parent 79fe55c71c
commit 5afd1a45a2
8 changed files with 26 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ class GuiHandSelf : public GuiHand
public:
GuiHandSelf(CardSelector* cs, MTGHand* hand);
~GuiHandSelf();
virtual int receiveEventPlus(WEvent* e);
virtual int receiveEventMinus(WEvent* e);

View File

@@ -37,6 +37,7 @@ class GuiMana : public GuiLayer
vector<ManaIcon*> manas;
public:
GuiMana();
~GuiMana();
virtual void Render();
virtual void Update(float dt);
virtual int receiveEventPlus(WEvent * e);

View File

@@ -77,6 +77,10 @@ DuelLayers::DuelLayers() : nbitems(0) {}
DuelLayers::~DuelLayers(){
for (int i = 0; i < nbitems; ++i) delete objects[i];
for (size_t i = 0; i < waiters.size(); ++i){
delete(waiters[i]);
}
}
int DuelLayers::unstoppableRenderInProgress(){

View File

@@ -41,6 +41,7 @@ GuiFrame::~GuiFrame()
delete(gold2);
delete(gold1);
delete(wood);
SAFE_DELETE(goldGlow);
}
void GuiFrame::Render()

View File

@@ -40,6 +40,8 @@ GuiHand::GuiHand(CardSelector* cs, MTGHand* hand) : GuiLayer(), hand(hand), cs(c
GuiHand::~GuiHand()
{
delete(back);
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
delete(*it);
}
void GuiHand::Update(float dt)
@@ -69,6 +71,11 @@ GuiHandSelf::GuiHandSelf(CardSelector* cs, MTGHand* hand) : GuiHand(cs, hand), s
{
limitor = NEW HandLimitor(this);
}
GuiHandSelf::~GuiHandSelf(){
SAFE_DELETE(limitor);
}
bool GuiHandSelf::CheckUserInput(u32 key)
{
//u32 trigger = options[REVERSE_TRIGGERS];

View File

@@ -120,6 +120,12 @@ GuiMana::GuiMana()
{
}
GuiMana::~GuiMana(){
for (vector<ManaIcon*>::iterator it = manas.begin(); it != manas.end(); ++it){
delete(*it);
}
}
void GuiMana::Render()
{
for (vector<ManaIcon*>::iterator it = manas.begin(); it != manas.end(); ++it)

View File

@@ -97,6 +97,9 @@ GuiPlay::GuiPlay(GameObserver* game, CardSelector* cs) : game(game), cs(cs)
GuiPlay::~GuiPlay()
{
for (iterator it = cards.begin(); it != cards.end(); ++it){
delete(*it);
}
}
bool isSpell(CardView* c) { return c->card->isSpell(); }

View File

@@ -137,6 +137,9 @@ GuiGameZone::GuiGameZone(float x, float y, bool hasFocus, MTGGameZone* zone, Gui
GuiGameZone::~GuiGameZone(){
if (cd) delete cd;
for (vector<TransientCardView*>::iterator it = cards.begin(); it != cards.end(); ++it){
delete(*it);
}
}
ostream& GuiGameZone::toString(ostream& out) const