diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 8db830d3a..8722c9606 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -35,6 +35,16 @@ SystemView::SystemView( populate(); } +SystemView::~SystemView() +{ + // Delete any existing extras. + for (auto entry : mEntries) { + for (auto extra : entry.data.backgroundExtras) + delete extra; + entry.data.backgroundExtras.clear(); + } +} + void SystemView::populate() { mEntries.clear(); @@ -110,10 +120,6 @@ void SystemView::populate() Vector2f denormalized = mCarousel.logoSize * e.data.logo->getOrigin(); e.data.logo->setPosition(denormalized.x(), denormalized.y(), 0.0); - // Delete any existing extras. - for (auto extra : e.data.backgroundExtras) - delete extra; - e.data.backgroundExtras.clear(); // Make background extras. e.data.backgroundExtras = ThemeData::makeExtras((*it)->getTheme(), "system", mWindow); diff --git a/es-app/src/views/SystemView.h b/es-app/src/views/SystemView.h index 0c2427751..e0387de94 100644 --- a/es-app/src/views/SystemView.h +++ b/es-app/src/views/SystemView.h @@ -52,6 +52,7 @@ class SystemView : public IList { public: SystemView(Window* window); + ~SystemView(); virtual void onShow() override; virtual void onHide() override; diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index bfc082bf0..a331f4186 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -43,6 +43,7 @@ ISimpleGameListView::ISimpleGameListView( ISimpleGameListView::~ISimpleGameListView() { + // Remove theme extras. for (auto extra : mThemeExtras) { removeChild(extra); delete extra; diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index a99ab997c..c20da0086 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -16,7 +16,7 @@ FT_Library Font::sLibrary = nullptr; int Font::getSize() const { return mSize; } -std::map< std::pair, std::weak_ptr > Font::sFontMap; +std::map, std::weak_ptr> Font::sFontMap; Font::FontFace::FontFace(ResourceData&& d, int size) : data(d) { @@ -213,7 +213,7 @@ std::vector getFallbackFontPaths() { std::vector fontPaths; - // Standard fonts, let's include them here for error checking purposes even though that's + // Standard fonts, let's include them here for exception handling purposes even though that's // not really the correct location. (The application will crash if they are missing.) ResourceManager::getInstance()-> getResourcePath(":/fonts/opensans_hebrew_condensed_light.ttf"); diff --git a/es-core/src/resources/Font.h b/es-core/src/resources/Font.h index ab8cc80a0..f0c6e707f 100644 --- a/es-core/src/resources/Font.h +++ b/es-core/src/resources/Font.h @@ -93,7 +93,7 @@ public: private: static FT_Library sLibrary; - static std::map< std::pair, std::weak_ptr > sFontMap; + static std::map, std::weak_ptr> sFontMap; Font(int size, const std::string& path); diff --git a/es-core/src/resources/TextureDataManager.h b/es-core/src/resources/TextureDataManager.h index 21ec8f807..0b2a17340 100644 --- a/es-core/src/resources/TextureDataManager.h +++ b/es-core/src/resources/TextureDataManager.h @@ -66,7 +66,7 @@ public: std::shared_ptr add(const TextureResource* key, bool tiled); // The texturedata being removed may be loading in a different thread. However it will - // be referenced by a smart point so we only need to remove it from our array and it + // be referenced by a smart pointer so we only need to remove it from our array and it // will be deleted when the other thread has finished with it. void remove(const TextureResource* key); diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index 8914ae8d2..874606b70 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -137,7 +137,7 @@ std::shared_ptr TextureResource::get(const std::string& path, b // Is it an SVG? if (key.first.substr(key.first.size() - 4, std::string::npos) != ".svg") { - // Probably not. Add it to our map. We don't add SVGs because 2 svgs might be + // Probably not. Add it to our map. We don't add SVGs because 2 SVGs might be // rasterized at different sizes. sTextureMap[key] = std::weak_ptr(tex); }