diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index 7a0c0fcfc..bfc082bf0 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -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& theme) { using namespace ThemeFlags; diff --git a/es-app/src/views/gamelist/ISimpleGameListView.h b/es-app/src/views/gamelist/ISimpleGameListView.h index 59a53b99d..d64a54090 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.h +++ b/es-app/src/views/gamelist/ISimpleGameListView.h @@ -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.