Skip to content

Commit

Permalink
calling lua C from GC
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitsharma5652 committed Jul 13, 2024
1 parent 6f311f8 commit ceb56f7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ngx_http_lua_worker_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,10 @@ ngx_http_lua_free_task_ctx(ngx_http_lua_task_ctx_t *ctx)
/* clean Lua stack */
vm = ctx->vm;

/* call collectgarbage("collect") */
lua_settop(vm, 0);
lua_getglobal(vm, "collectgarbage");
lua_pushstring(vm, "collect");
lua_pcall(vm, 1, 1, 0);

lua_settop(vm, 0);
/* force a full garbage-collection cycle */
lua_gc(L, LUA_GCCOLLECT, 0);
}


Expand Down

0 comments on commit ceb56f7

Please sign in to comment.