-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
+1
View File
@@ -64,6 +64,7 @@ class GuiHandSelf : public GuiHand
public: public:
GuiHandSelf(CardSelector* cs, MTGHand* hand); GuiHandSelf(CardSelector* cs, MTGHand* hand);
~GuiHandSelf();
virtual int receiveEventPlus(WEvent* e); virtual int receiveEventPlus(WEvent* e);
virtual int receiveEventMinus(WEvent* e); virtual int receiveEventMinus(WEvent* e);
+1
View File
@@ -37,6 +37,7 @@ class GuiMana : public GuiLayer
vector<ManaIcon*> manas; vector<ManaIcon*> manas;
public: public:
GuiMana(); GuiMana();
~GuiMana();
virtual void Render(); virtual void Render();
virtual void Update(float dt); virtual void Update(float dt);
virtual int receiveEventPlus(WEvent * e); virtual int receiveEventPlus(WEvent * e);
+4
View File
@@ -77,6 +77,10 @@ DuelLayers::DuelLayers() : nbitems(0) {}
DuelLayers::~DuelLayers(){ DuelLayers::~DuelLayers(){
for (int i = 0; i < nbitems; ++i) delete objects[i]; 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(){ int DuelLayers::unstoppableRenderInProgress(){
+1
View File
@@ -41,6 +41,7 @@ GuiFrame::~GuiFrame()
delete(gold2); delete(gold2);
delete(gold1); delete(gold1);
delete(wood); delete(wood);
SAFE_DELETE(goldGlow);
} }
void GuiFrame::Render() void GuiFrame::Render()
+7
View File
@@ -40,6 +40,8 @@ GuiHand::GuiHand(CardSelector* cs, MTGHand* hand) : GuiLayer(), hand(hand), cs(c
GuiHand::~GuiHand() GuiHand::~GuiHand()
{ {
delete(back); delete(back);
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
delete(*it);
} }
void GuiHand::Update(float dt) void GuiHand::Update(float dt)
@@ -69,6 +71,11 @@ GuiHandSelf::GuiHandSelf(CardSelector* cs, MTGHand* hand) : GuiHand(cs, hand), s
{ {
limitor = NEW HandLimitor(this); limitor = NEW HandLimitor(this);
} }
GuiHandSelf::~GuiHandSelf(){
SAFE_DELETE(limitor);
}
bool GuiHandSelf::CheckUserInput(u32 key) bool GuiHandSelf::CheckUserInput(u32 key)
{ {
//u32 trigger = options[REVERSE_TRIGGERS]; //u32 trigger = options[REVERSE_TRIGGERS];
+6
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() void GuiMana::Render()
{ {
for (vector<ManaIcon*>::iterator it = manas.begin(); it != manas.end(); ++it) for (vector<ManaIcon*>::iterator it = manas.begin(); it != manas.end(); ++it)
+3
View File
@@ -97,6 +97,9 @@ GuiPlay::GuiPlay(GameObserver* game, CardSelector* cs) : game(game), cs(cs)
GuiPlay::~GuiPlay() GuiPlay::~GuiPlay()
{ {
for (iterator it = cards.begin(); it != cards.end(); ++it){
delete(*it);
}
} }
bool isSpell(CardView* c) { return c->card->isSpell(); } bool isSpell(CardView* c) { return c->card->isSpell(); }
+3
View File
@@ -137,6 +137,9 @@ GuiGameZone::GuiGameZone(float x, float y, bool hasFocus, MTGGameZone* zone, Gui
GuiGameZone::~GuiGameZone(){ GuiGameZone::~GuiGameZone(){
if (cd) delete cd; if (cd) delete cd;
for (vector<TransientCardView*>::iterator it = cards.begin(); it != cards.end(); ++it){
delete(*it);
}
} }
ostream& GuiGameZone::toString(ostream& out) const ostream& GuiGameZone::toString(ostream& out) const