Erwan
-some memory leaks fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -41,6 +41,7 @@ GuiFrame::~GuiFrame()
|
||||
delete(gold2);
|
||||
delete(gold1);
|
||||
delete(wood);
|
||||
SAFE_DELETE(goldGlow);
|
||||
}
|
||||
|
||||
void GuiFrame::Render()
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user