]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: hlua: use hlua_unref() instead of luaL_unref()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 20 Mar 2023 14:09:33 +0000 (15:09 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:58:17 +0000 (08:58 +0200)
Replacing some luaL_unref(, LUA_REGISTRYINDEX) calls with hlua_unref()
which is simpler to use and more explicit.

src/hlua.c

index 840ed9be5236d84db755acc2fb650801e96f4fd1..bc00d467c96c065377473974897f100d67b43f49 100644 (file)
@@ -10641,7 +10641,7 @@ static void hlua_filter_deinit_per_thread(struct proxy *px, struct flt_conf *fco
 
        state_id = reg_flt_to_stack_id(conf->reg);
        L = hlua_states[state_id];
-       luaL_unref(L, LUA_REGISTRYINDEX, conf->ref[state_id]);
+       hlua_unref(L, conf->ref[state_id]);
 }
 
 static int hlua_filter_init(struct proxy *px, struct flt_conf *fconf)
@@ -10836,7 +10836,7 @@ static void hlua_filter_delete(struct stream *s, struct filter *filter)
 {
        struct hlua_flt_ctx *flt_ctx = filter->ctx;
 
-       luaL_unref(s->hlua->T, LUA_REGISTRYINDEX, flt_ctx->ref);
+       hlua_unref(s->hlua->T, flt_ctx->ref);
        hlua_ctx_destroy(flt_ctx->hlua[0]);
        hlua_ctx_destroy(flt_ctx->hlua[1]);
        pool_free(pool_head_hlua_flt_ctx, flt_ctx);