diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-21 16:40:27 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-21 16:40:27 +0300 |
commit | 4d993e1eaaca9cfa1c860aadb75caf8a9df5860d (patch) | |
tree | a5142618ae89ef44fb5bff0ab7e93e0009fe32bb /libs/liblua/src | |
parent | 41ee395da7530c17656bd06f84638ab8d9d3776d (diff) |
crash fix: MirLua crashes inside Options - Plugins if the plugin is disabled
Diffstat (limited to 'libs/liblua/src')
-rw-r--r-- | libs/liblua/src/lstate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/liblua/src/lstate.c b/libs/liblua/src/lstate.c index 11299d3743..0c056f9041 100644 --- a/libs/liblua/src/lstate.c +++ b/libs/liblua/src/lstate.c @@ -339,6 +339,9 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { LUA_API void lua_close (lua_State *L) { + if (!L) + return; + L = G(L)->mainthread; /* only the main thread can be closed */ lua_lock(L); close_state(L); |