mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
fixing segfault at exit
This commit is contained in:
@@ -43,10 +43,10 @@ namespace mlx
|
||||
Text& new_text = p_scene->CreateText(str);
|
||||
new_text.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
|
||||
new_text.SetColor(std::move(vec_color));
|
||||
if(m_pixelput_called)
|
||||
// if(m_pixelput_called)
|
||||
{
|
||||
m_draw_layer++;
|
||||
m_pixelput_called = false;
|
||||
// m_pixelput_called = false;
|
||||
}
|
||||
}
|
||||
else if(!p_scene->IsTextAtGivenDrawLayer(str, m_draw_layer))
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -21,4 +21,9 @@ namespace mlx
|
||||
});
|
||||
return (it != m_fonts_registry.end() ? *it : nullptr);
|
||||
}
|
||||
|
||||
void FontRegistry::Reset()
|
||||
{
|
||||
m_fonts_registry.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace mlx
|
||||
window.reset();
|
||||
}
|
||||
|
||||
m_font_registry.Reset();
|
||||
p_render_core.reset();
|
||||
p_sdl_manager.reset();
|
||||
#ifdef PROFILER
|
||||
|
||||
Reference in New Issue
Block a user