From b25cfdd3051333e3d226b26aba8dd37aefb5f9f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 5 Sep 2019 19:03:58 -0400 Subject: [PATCH] FontCache: Default destructor within the cpp file Avoids potentially inlining a lot of repeated destruction logic. This also allows the class to play nicer with forward declarations. While we're at it, we can also explicitly delete the move assignment/constructor (previously they were implicitly deleted, given the class contains a const reference). --- specter/include/specter/FontCache.hpp | 2 ++ specter/lib/FontCache.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/specter/include/specter/FontCache.hpp b/specter/include/specter/FontCache.hpp index fc291e426..fe1f14e03 100644 --- a/specter/include/specter/FontCache.hpp +++ b/specter/include/specter/FontCache.hpp @@ -176,6 +176,8 @@ class FontCache { public: FontCache(const hecl::Runtime::FileStoreManager& fileMgr); + ~FontCache(); + FontCache(const FontCache& other) = delete; FontCache& operator=(const FontCache& other) = delete; diff --git a/specter/lib/FontCache.cpp b/specter/lib/FontCache.cpp index 1add829ac..c6ba42461 100644 --- a/specter/lib/FontCache.cpp +++ b/specter/lib/FontCache.cpp @@ -613,6 +613,8 @@ FontCache::FontCache(const hecl::Runtime::FileStoreManager& fileMgr) hecl::MakeDir(m_cacheRoot.c_str()); } +FontCache::~FontCache() = default; + FontTag FontCache::prepCustomFont(std::string_view name, FT_Face face, FCharFilter filter, bool subpixel, float points, uint32_t dpi) { /* Quick validation */