mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-03-31 09:13:16 +02:00
Fixed memory leak when scrolling menu is being deallocated.
This commit is contained in:
@@ -59,6 +59,33 @@ ScrollingList::ScrollingList(Configuration &c,
|
|||||||
|
|
||||||
ScrollingList::~ScrollingList()
|
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)
|
void ScrollingList::SetItems(std::vector<ComponentItemBinding *> *spriteList)
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ void RetroFE::Run()
|
|||||||
bool running = true;
|
bool running = true;
|
||||||
Item *nextPageItem = NULL;
|
Item *nextPageItem = NULL;
|
||||||
bool adminMode = false;
|
bool adminMode = false;
|
||||||
bool selectActive = false;
|
|
||||||
RETROFE_STATE state = RETROFE_IDLE;
|
RETROFE_STATE state = RETROFE_IDLE;
|
||||||
|
|
||||||
Config.GetProperty("attractModeTime", attractModeTime);
|
Config.GetProperty("attractModeTime", attractModeTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user