Fixed a memory leak where some textures were not deleted during gamelist reloads.

This commit is contained in:
Leon Styhre 2020-08-08 22:29:32 +02:00
parent c9a3dbc82e
commit 295bb0c4c4
2 changed files with 10 additions and 2 deletions

View file

@ -41,6 +41,15 @@ ISimpleGameListView::ISimpleGameListView(
addChild(&mBackground);
}
ISimpleGameListView::~ISimpleGameListView()
{
for (auto extra : mThemeExtras) {
removeChild(extra);
delete extra;
}
mThemeExtras.clear();
}
void ISimpleGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
{
using namespace ThemeFlags;

View file

@ -17,8 +17,7 @@ class ISimpleGameListView : public IGameListView
{
public:
ISimpleGameListView(Window* window, FileData* root);
virtual ~ISimpleGameListView() {}
virtual ~ISimpleGameListView();
// Called when a new file is added, a file is removed, a file's metadata changes,
// or a file's children are sorted.