diff options
-rw-r--r-- | src/openssl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c index 7b2ce89..8977234 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -1185,6 +1185,15 @@ static void ex_newstate(lua_State *L) { | |||
1185 | struct ex_state *state; | 1185 | struct ex_state *state; |
1186 | struct lua_State *thr; | 1186 | struct lua_State *thr; |
1187 | 1187 | ||
1188 | lua_pushlightuserdata(L, (void *)&ex__gc); | ||
1189 | lua_gettable(L, LUA_REGISTRYINDEX); | ||
1190 | |||
1191 | if (!lua_isnil(L, -1)) { | ||
1192 | lua_pop(L, 1); | ||
1193 | |||
1194 | return; | ||
1195 | } | ||
1196 | |||
1188 | state = prepudata(L, sizeof *state, NULL, &ex__gc); | 1197 | state = prepudata(L, sizeof *state, NULL, &ex__gc); |
1189 | LIST_INIT(&state->data); | 1198 | LIST_INIT(&state->data); |
1190 | 1199 | ||