We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8bc42e2 commit a9f2e5dCopy full SHA for a9f2e5d
src/luv.c
@@ -859,6 +859,12 @@ static int loop_gc(lua_State *L) {
859
while (uv_loop_close(loop)) {
860
uv_run(loop, UV_RUN_DEFAULT);
861
}
862
+ // Set the loop to NULL to allow for multiple calls
863
+ // of luaopen_luv, e.g. requiring 'luv', then setting
864
+ // package.loaded['luv'] to nil, and then requiring 'luv' again.
865
+ // The context lives as long as the Lua state, so it's
866
+ // possible it could be around for multiple loops.
867
+ ctx->loop = NULL;
868
return 0;
869
870
0 commit comments