fixing segfault at exit

This commit is contained in:
2024-10-27 21:18:22 +01:00
parent dbf4d3cc5b
commit fed7111362
4 changed files with 9 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ namespace mlx
inline void RegisterFont(std::shared_ptr<Font> font);
inline void UnregisterFont(std::shared_ptr<Font> font);
inline std::shared_ptr<Font> GetFont(const std::filesystem::path& name, float scale);
inline void Reset();
~FontRegistry() = default;

View File

@@ -21,4 +21,9 @@ namespace mlx
});
return (it != m_fonts_registry.end() ? *it : nullptr);
}
void FontRegistry::Reset()
{
m_fonts_registry.clear();
}
}