From c9631253a2bc0a886193f26ce84ced0165e35028 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 24 Feb 2016 11:20:33 -1000 Subject: [PATCH] Add methods to support sequential resource destruction --- specter/include/Specter/FontCache.hpp | 2 ++ specter/include/Specter/ViewResources.hpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/specter/include/Specter/FontCache.hpp b/specter/include/Specter/FontCache.hpp index 8b999a231..e39e998d8 100644 --- a/specter/include/Specter/FontCache.hpp +++ b/specter/include/Specter/FontCache.hpp @@ -191,6 +191,8 @@ public: void closeBuiltinFonts() {m_regFace.close(); m_monoFace.close(); m_curvesFace.close();} const FontAtlas& lookupAtlas(FontTag tag) const; + + void destroyAtlases() {m_cachedAtlases.clear();} }; } diff --git a/specter/include/Specter/ViewResources.hpp b/specter/include/Specter/ViewResources.hpp index 5fefc5afe..e75e61233 100644 --- a/specter/include/Specter/ViewResources.hpp +++ b/specter/include/Specter/ViewResources.hpp @@ -188,6 +188,11 @@ public: ViewResources& operator=(const ViewResources& other) = delete; ViewResources& operator=(ViewResources&& other) = default; + void destroyResData() + { + m_resData.doDestroy(); + } + ~ViewResources() { if (m_fcacheThread.joinable())