Fixed memory leak when scrolling menu is being deallocated.

This commit is contained in:
emb 2015-01-01 20:23:34 -06:00
parent 09ff0ac704
commit b6c60ceb76
2 changed files with 27 additions and 1 deletions

View File

@ -59,6 +59,33 @@ ScrollingList::ScrollingList(Configuration &c,
ScrollingList::~ScrollingList()
{
if(SpriteList)
{
std::vector<ComponentItemBinding *>::iterator it = SpriteList->begin();
while(it != SpriteList->end())
{
if(*it != NULL)
{
Logger::Write(Logger::ZONE_DEBUG, "ScrollingList", "Free");
DeallocateTexture(*it);
if((*it)->GetCollectionItem())
{
delete (*it)->GetCollectionItem();
}
delete *it;
}
SpriteList->erase(it);
it = SpriteList->begin();
}
delete SpriteList;
SpriteList = NULL;
}
}
void ScrollingList::SetItems(std::vector<ComponentItemBinding *> *spriteList)

View File

@ -157,7 +157,6 @@ void RetroFE::Run()
bool running = true;
Item *nextPageItem = NULL;
bool adminMode = false;
bool selectActive = false;
RETROFE_STATE state = RETROFE_IDLE;
Config.GetProperty("attractModeTime", attractModeTime);