diff --git a/src/hlua.c b/src/hlua.c index 5383fe9a4..77e5a9d5c 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -7182,7 +7182,7 @@ void hlua_init(void) gL.Mref = LUA_REFNIL; gL.flags = 0; LIST_INIT(&gL.com); - gL.T = luaL_newstate(); + gL.T = lua_newstate(hlua_alloc, &hlua_global_allocator); hlua_sethlua(&gL); gL.Tref = LUA_REFNIL; gL.task = NULL; @@ -7192,9 +7192,6 @@ void hlua_init(void) * process of HAProxy, this abort() is tolerated. */ - /* change the memory allocators to track memory usage */ - lua_setallocf(gL.T, hlua_alloc, &hlua_global_allocator); - /* Initialise lua. */ luaL_openlibs(gL.T);