]> git.sesse.net Git - nageru/commitdiff
Properly take the Lua lock when processing menu callbacks.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 1 Mar 2018 08:27:55 +0000 (09:27 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 1 Mar 2018 08:27:55 +0000 (09:27 +0100)
theme.cpp

index 7240cd4c0f2ce3b7d4c2cb571f0b0c2891575a1b..8b2f6b6c612f101c01c7667cb1d996c71f8d3edb 100644 (file)
--- 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<mutex> 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));