summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui/ui.cpp')
-rw-r--r--src/frontend/mame/ui/ui.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 6e4ed7f3552..d65cf9c581b 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -164,7 +164,7 @@ static uint32_t const mouse_bitmap[32*32] =
mame_ui_manager::mame_ui_manager(running_machine &machine)
: ui_manager(machine)
- , m_font(nullptr)
+ , m_font()
, m_handler_callback(nullptr)
, m_handler_callback_type(ui_callback_type::GENERAL)
, m_handler_param(0)
@@ -244,11 +244,7 @@ void mame_ui_manager::exit()
m_mouse_arrow_texture = nullptr;
// free the font
- if (m_font != nullptr)
- {
- machine().render().font_free(m_font);
- m_font = nullptr;
- }
+ m_font.reset();
}
@@ -640,9 +636,9 @@ void mame_ui_manager::update_and_render(render_container &container)
render_font *mame_ui_manager::get_font()
{
// allocate the font and messagebox string
- if (m_font == nullptr)
+ if (!m_font)
m_font = machine().render().font_alloc(machine().options().ui_font());
- return m_font;
+ return m_font.get();
}