From: Steinar H. Gunderson Date: Thu, 1 Mar 2018 08:27:55 +0000 (+0100) Subject: Properly take the Lua lock when processing menu callbacks. X-Git-Tag: 1.7.0~4 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=52c5033edb39aa71c2a979b4788b622dc44683af;p=nageru Properly take the Lua lock when processing menu callbacks. --- diff --git a/theme.cpp b/theme.cpp index 7240cd4..8b2f6b6 100644 --- a/theme.cpp +++ b/theme.cpp @@ -1458,6 +1458,7 @@ int Theme::set_theme_menu(lua_State *L) void Theme::theme_menu_entry_clicked(int lua_ref) { + unique_lock lock(m); lua_rawgeti(L, LUA_REGISTRYINDEX, lua_ref); if (lua_pcall(L, 0, 0, 0) != 0) { fprintf(stderr, "error running menu callback: %s\n", lua_tostring(L, -1));