mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-26 16:48:51 +01:00
Fixed memory leak when scrolling menu is being deallocated.
This commit is contained in:
parent
09ff0ac704
commit
b6c60ceb76
@ -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)
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user