From 816e975d257f025f224c9cc8c6e758699d4e1137 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 14 Nov 2023 18:33:58 -0500 Subject: ui/menu.h: Refactor probably-unsafe code referencing temporary object --- src/frontend/mame/ui/menu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index eeeb7ae6eb3..c88abdc8cb2 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -278,11 +278,11 @@ protected: float maxwidth(origwidth); for (Iter it = begin; it != end; ++it) { - std::string_view const &line(*it); + std::string_view const line(*it); if (!line.empty()) { text_layout layout(*ui().get_font(), text_size * m_last_aspect, text_size, 1.0, justify, wrap); - layout.add_text(std::string_view(*it), rgb_t::white(), rgb_t::black()); + layout.add_text(line, rgb_t::white(), rgb_t::black()); maxwidth = (std::max)(layout.actual_width(), maxwidth); } } -- cgit v1.2.3