From 33245e7945cf76422e8931b93e0c3320fd8e9c6c Mon Sep 17 00:00:00 2001 From: cracyc Date: Sat, 30 Jul 2016 12:25:10 -0500 Subject: [PATCH] luaengine: (nw) --- src/frontend/mame/luaengine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 52af1b85bef..4bad1bb39c8 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -2006,7 +2006,8 @@ void lua_engine::menu_populate(std::string &menu, std::vector &menu_l { if(lua_istable(m_lua_state, -1)) { - menu_item item; + menu_list.emplace_back(); + menu_item &item = menu_list.back(); lua_rawgeti(m_lua_state, -1, 1); item.text = lua_tostring(m_lua_state, -1); lua_pop(m_lua_state, 1); @@ -2016,7 +2017,6 @@ void lua_engine::menu_populate(std::string &menu, std::vector &menu_l lua_rawgeti(m_lua_state, -1, 3); item.flags = lua_tostring(m_lua_state, -1); lua_pop(m_lua_state, 1); - menu_list.push_back(item); } lua_pop(m_lua_state, 1); }