diff options
Diffstat (limited to 'src/emu/rendfont.cpp')
-rw-r--r-- | src/emu/rendfont.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index 27a14bb0d55..bcd1ca35d78 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -123,7 +123,7 @@ render_font::render_font(render_manager &manager, const char *filename) m_yoffs(0), m_scale(1.0f), m_rawsize(0), - m_osdfont(nullptr), + m_osdfont(), m_height_cmd(0), m_yoffs_cmd(0) { @@ -134,19 +134,18 @@ render_font::render_font(render_manager &manager, const char *filename) if (filename != nullptr) { m_osdfont = manager.machine().osd().font_alloc(); - if (m_osdfont != nullptr) + if (m_osdfont) { if (m_osdfont->open(manager.machine().options().font_path(), filename, m_height)) { - m_scale = 1.0f / (float)m_height; - m_format = FF_OSD; + m_scale = 1.0f / (float)m_height; + m_format = FF_OSD; - //mamep: allocate command glyph font - render_font_command_glyph(); - return; - } - global_free(m_osdfont); - m_osdfont = nullptr; + //mamep: allocate command glyph font + render_font_command_glyph(); + return; + } + m_osdfont.reset(); } } @@ -199,13 +198,6 @@ render_font::~render_font() } delete[] elem; } - - // release the OSD font - if (m_osdfont != nullptr) - { - m_osdfont->close(); - global_free(m_osdfont); - } } |