summaryrefslogtreecommitdiff
path: root/libs/liblua/src/lstate.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2021-04-03 15:36:24 +0300
committerdartraiden <wowemuh@gmail.com>2021-04-03 15:36:24 +0300
commit9a749bc628747c148394314a97fdeae6e032dc0b (patch)
tree124ec4646a3ca28936998bcd92d175b3bdfc7db1 /libs/liblua/src/lstate.c
parent875bc74fa5fe083ba0b5c5a785c53ec0f49b9a1b (diff)
liblua: pick up Miranda-specific commits
Diffstat (limited to 'libs/liblua/src/lstate.c')
-rw-r--r--libs/liblua/src/lstate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/liblua/src/lstate.c b/libs/liblua/src/lstate.c
index c5e3b437f1..0af817a0d5 100644
--- a/libs/liblua/src/lstate.c
+++ b/libs/liblua/src/lstate.c
@@ -408,6 +408,9 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
LUA_API void lua_close (lua_State *L) {
+ if (!L)
+ return;
+
lua_lock(L);
L = G(L)->mainthread; /* only the main thread can be closed */
close_state(L);